If we receive a signal from the command we executed, do not forward

it back to the command.  This fixes a problem with BSD-derived
versions of the reboot command which send SIGTERM to all other
processes, including the sudo process.  Sudo would then deliver
SIGTERM to reboot which would die before calling the reboot() system
call, effectively leaving the system in single user mode.
This commit is contained in:
Todd C. Miller
2012-08-06 14:38:35 -04:00
parent d10fb81fe5
commit dc08cf3c99
4 changed files with 178 additions and 50 deletions

View File

@@ -165,6 +165,7 @@ struct command_status {
#define CMD_ERRNO 1
#define CMD_WSTATUS 2
#define CMD_SIGNO 3
#define CMD_PID 4
int type;
int val;
};