From cd692b5a68be0eb95252380db97fbbec587d6350 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 30 May 2022 12:48:57 +0000 Subject: Add an ACL list for users connecting to the tmux socket. Users may be forbidden from attaching, forced to attach read-only, or allowed to attach read-write. A new command, server-access, configures the list. tmux gets the user using getpeereid(3) of the client socket. Users must still configure file system permissions manually. From Dallas Lyons and others. --- cmd-attach-session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd-attach-session.c') diff --git a/cmd-attach-session.c b/cmd-attach-session.c index cc795b22..b92a7f2b 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -43,7 +43,7 @@ const struct cmd_entry cmd_attach_session_entry = { /* -t is special */ - .flags = CMD_STARTSERVER, + .flags = CMD_STARTSERVER|CMD_READONLY, .exec = cmd_attach_session_exec }; @@ -69,6 +69,7 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, if (c == NULL) return (CMD_RETURN_NORMAL); + if (server_client_check_nested(c)) { cmdq_error(item, "sessions should be nested with care, " "unset $TMUX to force"); -- cgit From 1afe22086fb85a596eb4a20f2e80cacfbbc2f1e5 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 Jul 2022 08:40:52 +0000 Subject: Show config errors on attach if they were not shown when the session was created. --- cmd-attach-session.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd-attach-session.c') diff --git a/cmd-attach-session.c b/cmd-attach-session.c index b92a7f2b..4e2d15da 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -158,6 +158,9 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, c->flags |= CLIENT_ATTACHED; } + if (cfg_finished) + cfg_show_causes(s); + return (CMD_RETURN_NORMAL); } -- cgit