summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2011-09-25 18:53:04 +0000
committernicm <nicm@openbsd.org>2011-09-25 18:53:04 +0000
commita89a0cee0e4b7c85d8511ad444f84653c2a41d82 (patch)
tree609df78d18d44a493ca7fd7437561eee5d6a5440 /usr.bin/tmux/tmux.c
parenttweak previous; ok schwarze (diff)
downloadwireguard-openbsd-a89a0cee0e4b7c85d8511ad444f84653c2a41d82.tar.xz
wireguard-openbsd-a89a0cee0e4b7c85d8511ad444f84653c2a41d82.zip
Reject $SHELL if it is not a full path.
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index b12a8fbbb52..d5320ea1d18 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.104 2011/03/04 23:26:44 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.105 2011/09/25 18:53:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -98,7 +98,9 @@ getshell(void)
int
checkshell(const char *shell)
{
- if (shell == NULL || *shell == '\0' || areshell(shell))
+ if (shell == NULL || *shell == '\0' || *shell != '/')
+ return (0);
+ if (areshell(shell))
return (0);
if (access(shell, X_OK) != 0)
return (0);