mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 08:14:24 +02:00
upstream commit
avoid de-const warning & shrink; ok dtucker@ Upstream-ID: 69a85ef94832378952a22c172009cbf52aaa11db
This commit is contained in:
parent
03239c1831
commit
2aaba0cfd5
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: readconf.c,v 1.243 2015/10/25 23:14:03 dtucker Exp $ */
|
/* $OpenBSD: readconf.c,v 1.244 2015/10/27 00:49:53 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
@ -458,7 +458,7 @@ execute_in_shell(const char *cmd)
|
|||||||
|
|
||||||
/* Fork and execute the command. */
|
/* Fork and execute the command. */
|
||||||
if ((pid = fork()) == 0) {
|
if ((pid = fork()) == 0) {
|
||||||
char *argv[4];
|
char *argv[] = { shell, "-c", xstrdup(cmd), NULL };
|
||||||
|
|
||||||
/* Child. Permanently give up superuser privileges. */
|
/* Child. Permanently give up superuser privileges. */
|
||||||
permanently_drop_suid(original_real_uid);
|
permanently_drop_suid(original_real_uid);
|
||||||
@ -472,11 +472,6 @@ execute_in_shell(const char *cmd)
|
|||||||
close(devnull);
|
close(devnull);
|
||||||
closefrom(STDERR_FILENO + 1);
|
closefrom(STDERR_FILENO + 1);
|
||||||
|
|
||||||
argv[0] = shell;
|
|
||||||
argv[1] = "-c";
|
|
||||||
argv[2] = cmd;
|
|
||||||
argv[3] = NULL;
|
|
||||||
|
|
||||||
execv(argv[0], argv);
|
execv(argv[0], argv);
|
||||||
error("Unable to execute '%.100s': %s", cmd, strerror(errno));
|
error("Unable to execute '%.100s': %s", cmd, strerror(errno));
|
||||||
/* Die with signal to make this error apparent to parent. */
|
/* Die with signal to make this error apparent to parent. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user