[openssh-commits] [openssh] 05/08: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Oct 29 19:07:32 AEDT 2015


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

djm pushed a commit to branch master
in repository openssh.

commit a4aef3ed29071719b2af82fdf1ac3c2514f82bc5
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Tue Oct 27 08:54:52 2015 +0000

    upstream commit
    
    fix execv arguments in a way less likely to cause grief
     for -portable; ok dtucker@
    
    Upstream-ID: 5902bf0ea0371f39f1300698dc3b8e4105fc0fc5
---
 readconf.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/readconf.c b/readconf.c
index acfe97e..c062433 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.244 2015/10/27 00:49:53 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.245 2015/10/27 08:54:52 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -458,7 +458,7 @@ execute_in_shell(const char *cmd)
 
 	/* Fork and execute the command. */
 	if ((pid = fork()) == 0) {
-		char *argv[] = { shell, "-c", xstrdup(cmd), NULL };
+		char *argv[4];
 
 		/* Child.  Permanently give up superuser privileges. */
 		permanently_drop_suid(original_real_uid);
@@ -472,6 +472,11 @@ execute_in_shell(const char *cmd)
 			close(devnull);
 		closefrom(STDERR_FILENO + 1);
 
+		argv[0] = shell;
+		argv[1] = "-c";
+		argv[2] = xstrdup(cmd);
+		argv[3] = NULL;
+
 		execv(argv[0], argv);
 		error("Unable to execute '%.100s': %s", cmd, strerror(errno));
 		/* Die with signal to make this error apparent to parent. */

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


More information about the openssh-commits mailing list