Re: sudo ignores SIGPIPE and hangs
"Todd C. Miller" <[email protected]>
| Newsgroups | gmane.comp.tools.sudo.devel |
|---|---|
| Message-ID | <[email protected]> |
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);
}
____________________________________________________________
sudo-workers mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
https://www.sudo.ws/mailman/listinfo/sudo-workers