From: Todd C. Miller Date: Wed, 9 Sep 2015 16:50:21 +0000 (-0600) Subject: Fill in cstat if exec_setup() fails. Previously it was only filled X-Git-Tag: SUDO_1_8_15^2~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d08faa73a76cbd7d0afc20828649336c6ae714cd;p=sudo Fill in cstat if exec_setup() fails. Previously it was only filled in for an execve() failure. Fixes an unkillable sudo process when exec_setup() fails and I/O logging is enabled. --- diff --git a/src/exec.c b/src/exec.c index 4e4046a6a..c9a3712d7 100644 --- a/src/exec.c +++ b/src/exec.c @@ -184,11 +184,11 @@ exec_cmnd(struct command_details *details, struct command_status *cstat, sudo_execve(details->command, details->argv, details->envp, ISSET(details->flags, CD_NOEXEC)); } - cstat->type = CMD_ERRNO; - cstat->val = errno; - sudo_debug_printf(SUDO_DEBUG_ERROR, "unable to exec %s: %s", - details->command, strerror(errno)); } + cstat->type = CMD_ERRNO; + cstat->val = errno; + sudo_debug_printf(SUDO_DEBUG_ERROR, "unable to exec %s: %s", + details->command, strerror(errno)); debug_return; }