[sudo-users] Improper setting / resetting of the signals mask
Todd C. Miller
Todd.Miller at courtesan.com
Tue Sep 14 09:49:45 EDT 2010
In message <AANLkTik39j45XmArWreOJK71hMr561iD0iw04qYXN=2i at mail.gmail.com>
so spake "Ciprian Dorin, Craciun" (ciprian.craciun):
> In short `sudo` doesn't seem to reset (zero out) its inherited
> signal mask, and `runit` seems to leave some signals blocked when
> exec-ing children. (And the side-effect is breaking some service
> management scripts.)
The following patch should address that.
- todd
--- sudo.c.orig Mon Sep 6 08:16:09 2010
+++ sudo.c Tue Sep 14 09:48:48 2010
@@ -1050,9 +1050,14 @@
initial_setup()
{
int miss[3], devnull = -1;
+ sigset_t mask;
#if defined(__linux__) || (defined(RLIMIT_CORE) && !defined(SUDO_DEVEL))
struct rlimit rl;
#endif
+
+ /* Reset signal mask. */
+ (void) sigemptyset(&mask);
+ (void) sigprocmask(SIG_SETMASK, &mask, NULL);
#if defined(__linux__)
/*
More information about the sudo-users
mailing list