]> granicus.if.org Git - sudo/commitdiff
Fill in cstat if exec_setup() fails. Previously it was only filled
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Sep 2015 16:50:21 +0000 (10:50 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Sep 2015 16:50:21 +0000 (10:50 -0600)
in for an execve() failure.  Fixes an unkillable sudo process when
exec_setup() fails and I/O logging is enabled.

src/exec.c

index 4e4046a6a47acd48f037edb428e91e297b53e1e2..c9a3712d7d0af60e702f30300872ec8e03ed084a 100644 (file)
@@ -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;
 }