diff options
author | 2020-03-17 11:10:12 +0000 | |
---|---|---|
committer | 2020-03-17 11:10:12 +0000 | |
commit | e8bf146742fb668207405d18d60937b3e46e0da7 (patch) | |
tree | 9cceca189d183248d89f60b6f8df692483a07861 /usr.bin/tmux/server-client.c | |
parent | Fix inline assembly in ppc_mftb(); using %L0 instead of %0+1 makes this work (diff) | |
download | wireguard-openbsd-e8bf146742fb668207405d18d60937b3e46e0da7.tar.xz wireguard-openbsd-e8bf146742fb668207405d18d60937b3e46e0da7.zip |
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 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index c33be44fa0b..f4666cd704f 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.307 2020/03/16 06:12:42 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.308 2020/03/17 11:10:12 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); |