aboutsummaryrefslogtreecommitdiff
path: root/cmd-attach-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2022-04-06 14:28:50 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2022-04-06 14:28:50 +0100
commitd6306b634e4a044e3380ed984dc7f5e5d67e69ac (patch)
treeb37630b42c687c2d470529e9c78e3f29d24775e3 /cmd-attach-session.c
parent6e9a9d265e2c5199566e3890e6763a74b558bf80 (diff)
downloadrtmux-d6306b634e4a044e3380ed984dc7f5e5d67e69ac.tar.gz
rtmux-d6306b634e4a044e3380ed984dc7f5e5d67e69ac.tar.bz2
rtmux-d6306b634e4a044e3380ed984dc7f5e5d67e69ac.zip
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.
Diffstat (limited to 'cmd-attach-session.c')
-rw-r--r--cmd-attach-session.c3
1 files changed, 2 insertions, 1 deletions
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");