From: Todd C. Miller Date: Thu, 15 Jun 2017 13:51:02 +0000 (-0600) Subject: Add debug warning when we have wait status but don't overwrite the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5b60ef749ec185ba61ed293f178b701a2f551c6;p=sudo Add debug warning when we have wait status but don't overwrite the existing cstat. --- diff --git a/src/exec_monitor.c b/src/exec_monitor.c index 47b0227dc..b8dc133be 100644 --- a/src/exec_monitor.c +++ b/src/exec_monitor.c @@ -211,6 +211,10 @@ mon_handle_sigchld(struct monitor_closure *mc) send_status(mc->backchannel, mc->cstat); } } + } else { + sudo_debug_printf(SUDO_DEBUG_WARN, + "%s: not overwriting command status %d,%d with %d,%d", + __func__, mc->cstat->type, mc->cstat->val, CMD_WSTATUS, status); } debug_return; diff --git a/src/exec_nopty.c b/src/exec_nopty.c index 77362eaa0..c4780dc1c 100644 --- a/src/exec_nopty.c +++ b/src/exec_nopty.c @@ -553,6 +553,10 @@ handle_sigchld_nopty(struct exec_closure_nopty *ec) if (ec->cstat->type == CMD_INVALID) { ec->cstat->type = CMD_WSTATUS; ec->cstat->val = status; + } else { + sudo_debug_printf(SUDO_DEBUG_WARN, + "%s: not overwriting command status %d,%d with %d,%d", + __func__, ec->cstat->type, ec->cstat->val, CMD_WSTATUS, status); } ec->cmnd_pid = -1; }