From d08faa73a76cbd7d0afc20828649336c6ae714cd Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 9 Sep 2015 10:50:21 -0600 Subject: [PATCH] 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. --- src/exec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.50.1