summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-09-23 15:00:09 +0000
committerTiago Cunha <tcunha@gmx.com>2009-09-23 15:00:09 +0000
commit1310ea2729c4f51b9de29c10fb7ea176345cfd44 (patch)
tree1208cd7be9b03ee7b14cb3bf5a28273089cc97b7 /client.c
parent2acf349d4e855eeb8b5d8303cc89aec016210e30 (diff)
Sync OpenBSD patchset 347:
Remove the internal tmux locking and instead detach each client and run the command specified by a new option "lock-command" (by default "lock -np") in each client. This means each terminal has to be unlocked individually but simplifies the code and allows the system password to be used to unlock. Note that the set-password command is gone, so it will need to be removed from configuration files, and the -U command line flag has been removed. This is the third protocol version change so again it is best to stop the tmux server before upgrading.
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/client.c b/client.c
index aebf7784..070fae10 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.73 2009-09-23 14:44:02 tcunha Exp $ */
+/* $Id: client.c,v 1.74 2009-09-23 15:00:08 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -246,6 +246,7 @@ client_msg_dispatch(struct client_ctx *cctx)
{
struct imsg imsg;
struct msg_print_data printdata;
+ struct msg_lock_data lockdata;
ssize_t n, datalen;
for (;;) {
@@ -299,6 +300,15 @@ client_msg_dispatch(struct client_ctx *cctx)
client_suspend();
break;
+ case MSG_LOCK:
+ if (datalen != sizeof lockdata)
+ fatalx("bad MSG_LOCK size");
+ memcpy(&lockdata, imsg.data, sizeof lockdata);
+
+ lockdata.cmd[(sizeof lockdata.cmd) - 1] = '\0';
+ system(lockdata.cmd);
+ client_write_server(cctx, MSG_UNLOCK, NULL, 0);
+ break;
default:
fatalx("unexpected message");
}