From e756da33bd404fd890245d96a8217b2485e7c0bd Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 9 Aug 2019 05:05:55 +0000 Subject: 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 --- usr.bin/ssh/readconf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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 * Copyright (c) 1995 Tatu Ylonen , 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)); -- cgit v1.2.3