[openssh-commits] [openssh] 02/02: upstream: produce a useful error message if the user's shell is set

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Aug 9 15:15:37 AEST 2019


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 9ab5b9474779ac4f581d402ae397f871ed16b383
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri Aug 9 05:05:54 2019 +0000

    upstream: 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
    
    OpenBSD-Commit-ID: cf9eddd6a6be726cb73bd9c3936f3888cd85c03d
---
 readconf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/readconf.c b/readconf.c
index 27b535e1..d1b7871e 100644
--- a/readconf.c
+++ b/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 at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -486,6 +486,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));

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list