summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2020-03-17 11:10:12 +0000
committernicm <nicm>2020-03-17 11:10:12 +0000
commit115bb33257ece9eec1c890cc04683227678a895f (patch)
tree0352f5aa8363bd3f98f9c6f2f94d0354c85a88d0 /server-client.c
parentfb396286ff8330f35eae54f47b7f233839a23e6f (diff)
Ignore default-shell (and use /bin/sh) if it invalid not just if it is
tmux itself, also refuse to set the option to something invalid in the first place. GitHub issue 2120.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server-client.c b/server-client.c
index 02113386..f3a2b044 100644
--- a/server-client.c
+++ b/server-client.c
@@ -400,6 +400,8 @@ server_client_exec(struct client *c, const char *cmd)
shell = options_get_string(s->options, "default-shell");
else
shell = options_get_string(global_s_options, "default-shell");
+ if (!checkshell(shell))
+ shell = _PATH_BSHELL;
shellsize = strlen(shell) + 1;
msg = xmalloc(cmdsize + shellsize);
@@ -2009,7 +2011,7 @@ server_client_dispatch_shell(struct client *c)
const char *shell;
shell = options_get_string(global_s_options, "default-shell");
- if (*shell == '\0' || areshell(shell))
+ if (!checkshell(shell))
shell = _PATH_BSHELL;
proc_send(c->peer, MSG_SHELL, -1, shell, strlen(shell) + 1);