summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2019-08-09 05:05:55 +0000
committerDamien Miller <djm@cvs.openbsd.org>2019-08-09 05:05:55 +0000
commite756da33bd404fd890245d96a8217b2485e7c0bd (patch)
treec9495f8e6091f4a8d4279cd455e00f2a15cf117c /usr.bin
parentaca55e4ba13da7cf9ed306ea9b45021eaf6d208a (diff)
produce a useful error message if the user's shell is set incorrectly
during "match exec" processing. bz#2791 reported by Dario Bertini; ok dtucker
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/readconf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c
index b902aa35c1f..4b79e505bf7 100644
--- a/usr.bin/ssh/readconf.c
+++ b/usr.bin/ssh/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.307 2019/06/28 13:35:04 deraadt Exp $ */
+/* $OpenBSD: readconf.c,v 1.308 2019/08/09 05:05:54 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -471,6 +471,11 @@ execute_in_shell(const char *cmd)
if ((shell = getenv("SHELL")) == NULL)
shell = _PATH_BSHELL;
+ if (access(shell, X_OK) == -1) {
+ fatal("Shell \"%s\" is not executable: %s",
+ shell, strerror(errno));
+ }
+
/* Need this to redirect subprocess stdin/out */
if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1)
fatal("open(/dev/null): %s", strerror(errno));