aboutsummaryrefslogtreecommitdiff
path: root/server-msg.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 /server-msg.c
parent2acf349d4e855eeb8b5d8303cc89aec016210e30 (diff)
downloadrtmux-1310ea2729c4f51b9de29c10fb7ea176345cfd44.tar.gz
rtmux-1310ea2729c4f51b9de29c10fb7ea176345cfd44.tar.bz2
rtmux-1310ea2729c4f51b9de29c10fb7ea176345cfd44.zip
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 'server-msg.c')
-rw-r--r--server-msg.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/server-msg.c b/server-msg.c
index cecf9aa9..7cfdc2d9 100644
--- a/server-msg.c
+++ b/server-msg.c
@@ -1,4 +1,4 @@
-/* $Id: server-msg.c,v 1.86 2009-09-23 14:44:02 tcunha Exp $ */
+/* $Id: server-msg.c,v 1.87 2009-09-23 15:00:08 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -40,7 +40,6 @@ server_msg_dispatch(struct client *c)
struct imsg imsg;
struct msg_command_data commanddata;
struct msg_identify_data identifydata;
- struct msg_unlock_data unlockdata;
struct msg_environ_data environdata;
ssize_t n, datalen;
@@ -95,31 +94,15 @@ server_msg_dispatch(struct client *c)
tty_close(&c->tty);
server_write_client(c, MSG_EXITED, NULL, 0);
break;
- case MSG_UNLOCK:
- if (datalen != sizeof unlockdata)
- fatalx("bad MSG_UNLOCK size");
- memcpy(&unlockdata, imsg.data, sizeof unlockdata);
-
- unlockdata.pass[(sizeof unlockdata.pass) - 1] = '\0';
- switch (server_unlock(unlockdata.pass)) {
- case -1:
- server_write_error(c, "bad password");
- break;
- case -2:
- server_write_error(c,
- "too many bad passwords, sleeping");
- break;
- }
- memset(&unlockdata, 0, sizeof unlockdata);
- server_write_client(c, MSG_EXIT, NULL, 0);
- break;
case MSG_WAKEUP:
+ case MSG_UNLOCK:
if (datalen != 0)
fatalx("bad MSG_WAKEUP size");
c->flags &= ~CLIENT_SUSPENDED;
tty_start_tty(&c->tty);
server_redraw_client(c);
+ server_activity = time(NULL);
break;
case MSG_ENVIRON:
if (datalen != sizeof environdata)