diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-02-08 18:27:34 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-02-08 18:27:34 +0000 |
commit | c6ba78137977bd7a447fd5f97b205544c2b41505 (patch) | |
tree | ec4d93053a821886b0a651d9d88d277d1e92966b /cmd-attach-session.c | |
parent | 9b57743cca71a7b2313a8d4f41558e8ec0404d9b (diff) | |
download | rtmux-c6ba78137977bd7a447fd5f97b205544c2b41505.tar.gz rtmux-c6ba78137977bd7a447fd5f97b205544c2b41505.tar.bz2 rtmux-c6ba78137977bd7a447fd5f97b205544c2b41505.zip |
Sync OpenBSD patchset 639:
Support attaching a client read-only with a new -r flag to the attach-session
command.
Diffstat (limited to 'cmd-attach-session.c')
-rw-r--r-- | cmd-attach-session.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd-attach-session.c b/cmd-attach-session.c index e55f7c46..0dea764f 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-attach-session.c,v 1.35 2009-12-04 22:14:47 tcunha Exp $ */ +/* $Id: cmd-attach-session.c,v 1.36 2010-02-08 18:27:34 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -28,8 +28,8 @@ int cmd_attach_session_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_attach_session_entry = { "attach-session", "attach", - "[-d] " CMD_TARGET_SESSION_USAGE, - CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d", + "[-dr] " CMD_TARGET_SESSION_USAGE, + CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "dr", cmd_target_init, cmd_target_parse, cmd_attach_session_exec, @@ -89,6 +89,9 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) return (-1); } + if (cmd_check_flag(data->chflags, 'r')) + ctx->cmdclient->flags |= CLIENT_READONLY; + if (cmd_check_flag(data->chflags, 'd')) server_write_session(s, MSG_DETACH, NULL, 0); |