[sudo-workers] sudo ignores SIGPIPE and hangs
Todd C. Miller
Todd.Miller at courtesan.com
Wed Aug 24 08:53:52 MDT 2016
On Wed, 24 Aug 2016 09:13:13 -0400, Radovan Sroka wrote:
> Sudo ignores SIGPIPE until the command is executed since 1.8.17b4.
>
> When pam_session, pam_setcred and use_pty are disabled sudo will
> not fork just exec, and SIGPIPE will be still ignored so e.g. this
> usecase will hang.
This is an oversight. The following diff fixes it.
- todd
diff -r abe28b6b7663 src/signal.c
--- a/src/signal.c Mon Aug 22 07:13:02 2016 -0600
+++ b/src/signal.c Wed Aug 24 08:53:05 2016 -0600
@@ -155,7 +155,7 @@
/* Ignore SIGPIPE until exec. */
if (saved_signals[SAVED_SIGPIPE].sa.sa_handler != SIG_IGN) {
sa.sa_handler = SIG_IGN;
- if (sigaction(SIGPIPE, &sa, NULL) != 0)
+ if (sudo_sigaction(SIGPIPE, &sa, NULL) != 0)
sudo_warn(U_("unable to set handler for signal %d"), SIGPIPE);
}
More information about the sudo-workers
mailing list