summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--readconf.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/readconf.c b/readconf.c
index 01e3d23e3..acfe97e9d 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.243 2015/10/25 23:14:03 dtucker Exp $ */ 1/* $OpenBSD: readconf.c,v 1.244 2015/10/27 00:49:53 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -458,7 +458,7 @@ execute_in_shell(const char *cmd)
458 458
459 /* Fork and execute the command. */ 459 /* Fork and execute the command. */
460 if ((pid = fork()) == 0) { 460 if ((pid = fork()) == 0) {
461 char *argv[4]; 461 char *argv[] = { shell, "-c", xstrdup(cmd), NULL };
462 462
463 /* Child. Permanently give up superuser privileges. */ 463 /* Child. Permanently give up superuser privileges. */
464 permanently_drop_suid(original_real_uid); 464 permanently_drop_suid(original_real_uid);
@@ -472,11 +472,6 @@ execute_in_shell(const char *cmd)
472 close(devnull); 472 close(devnull);
473 closefrom(STDERR_FILENO + 1); 473 closefrom(STDERR_FILENO + 1);
474 474
475 argv[0] = shell;
476 argv[1] = "-c";
477 argv[2] = cmd;
478 argv[3] = NULL;
479
480 execv(argv[0], argv); 475 execv(argv[0], argv);
481 error("Unable to execute '%.100s': %s", cmd, strerror(errno)); 476 error("Unable to execute '%.100s': %s", cmd, strerror(errno));
482 /* Die with signal to make this error apparent to parent. */ 477 /* Die with signal to make this error apparent to parent. */