diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2015-10-26 00:14:03 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-10-29 09:07:11 +0100 |
commit | 97e184e508dd33c37860c732c0eca3fc57698b40 (patch) | |
tree | 0deab18eee7b77d305c570834bec2ec66080eeda /readconf.c | |
parent | Prevent name collisions with system glob (bz#2463) (diff) | |
download | openssh-97e184e508dd33c37860c732c0eca3fc57698b40.tar.xz openssh-97e184e508dd33c37860c732c0eca3fc57698b40.zip |
upstream commit
Do not prepend "exec" to the shell command run by "Match
exec" in a config file. It's an unnecessary optimization from repurposed
ProxyCommand code and prevents some things working with some shells.
bz#2471, pointed out by res at qoxp.net. ok markus@
Upstream-ID: a1ead25ae336bfa15fb58d8c6b5589f85b4c33a3
Diffstat (limited to '')
-rw-r--r-- | readconf.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/readconf.c b/readconf.c index 94bf7e1b4..01e3d23e3 100644 --- a/readconf.c +++ b/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.242 2015/10/07 15:59:12 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.243 2015/10/25 23:14:03 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -442,7 +442,7 @@ default_ssh_port(void) static int execute_in_shell(const char *cmd) { - char *shell, *command_string; + char *shell; pid_t pid; int devnull, status; extern uid_t original_real_uid; @@ -450,12 +450,6 @@ execute_in_shell(const char *cmd) if ((shell = getenv("SHELL")) == NULL) shell = _PATH_BSHELL; - /* - * Use "exec" to avoid "sh -c" processes on some platforms - * (e.g. Solaris) - */ - xasprintf(&command_string, "exec %s", cmd); - /* Need this to redirect subprocess stdin/out */ if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1) fatal("open(/dev/null): %s", strerror(errno)); @@ -480,7 +474,7 @@ execute_in_shell(const char *cmd) argv[0] = shell; argv[1] = "-c"; - argv[2] = command_string; + argv[2] = cmd; argv[3] = NULL; execv(argv[0], argv); @@ -495,7 +489,6 @@ execute_in_shell(const char *cmd) fatal("%s: fork: %.100s", __func__, strerror(errno)); close(devnull); - free(command_string); while (waitpid(pid, &status, 0) == -1) { if (errno != EINTR && errno != EAGAIN) |