Add debug warning when we have wait status but don't overwrite the

existing cstat.
This commit is contained in:
Todd C. Miller
2017-06-15 07:51:02 -06:00
parent c8c586ee0b
commit f5b60ef749
2 changed files with 8 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;
}