diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-09-23 06:18:47 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-09-23 06:18:47 +0000 |
commit | b01dcd79715d968cb39dc892215c2f6921d43974 (patch) | |
tree | 1ccd6b4de2d9910d190fc42917d751a92edba628 /client.c | |
parent | 962fa20b36cc6d38d9a44612441f3f706c29b71e (diff) |
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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -242,6 +242,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 (;;) { @@ -295,6 +296,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"); } |