supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Todd C. Miller" <Todd.Miller@courtesan.com>
Cc: supervision@list.skarnet.org, sudo-users@sudo.ws
Subject: Re: Improper setting / resetting of the signals mask
Date: Tue, 14 Sep 2010 09:49:45 -0400	[thread overview]
Message-ID: <201009141349.o8EDnjZm013606@core.courtesan.com> (raw)
In-Reply-To: Your message of "Tue, 14 Sep 2010 14:14:45 +0300." <AANLkTik39j45XmArWreOJK71hMr561iD0iw04qYXN=2i@mail.gmail.com>

In message <AANLkTik39j45XmArWreOJK71hMr561iD0iw04qYXN=2i@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__)
     /*
____________________________________________________________
sudo-users mailing list <sudo-users@sudo.ws>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-users


  reply	other threads:[~2010-09-14 13:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14 11:14 Ciprian Dorin, Craciun
2010-09-14 13:49 ` Todd C. Miller [this message]
2010-09-14 20:22 ` Laurent Bercot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201009141349.o8EDnjZm013606@core.courtesan.com \
    --to=todd.miller@courtesan.com \
    --cc=sudo-users@sudo.ws \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).