Skip to contentSkip to conversation

policycoreutils: run_init blocks sigCHLD but doesn't unblock it before exec

PATCH Manoj Srivastava 2 participants 2 messages Sep 15, 2005 – Sep 20, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,

This was reported by a Debian user trying to run munin. Since
I forgot to unblock SIGCHLD, his causes weird errors e.g. in perl which apparently assumes that CHLD is not blocked on startup. (and thus breaks libnet-server-perl, used by munin or lrrd).

The following patch is a simple fix.

manoj

run_init/open_init_pty.c +10 -2
@@ -4,9 +4,9 @@
  * Created On       : Fri Jan 14 10:48:28 2005
  * Created On Node  : glaurung.internal.golden-gryphon.com
  * Last Modified By : Manoj Srivastava
- * Last Modified On : Thu Jan 20 23:50:04 2005
+ * Last Modified On : Thu Sep 15 00:57:00 2005
  * Last Machine Used: glaurung.internal.golden-gryphon.com
- * Update Count     : 89
+ * Update Count     : 92
  * Status           : Unknown, Use with caution!
  * HISTORY          : 
  * Description      : 
@@ -192,6 +192,14 @@
         perror("Child:");
         exit(EXIT_FAILURE);
       }
+     { /* There is no reason to block sigchild for the process we
+          shall exec here */
+       sigset_t  chld_signal_set;
+       /* release SIGCHLD */
+       sigemptyset(&chld_signal_set);        /* no signals */
+       sigaddset(&chld_signal_set, SIGCHLD); /* Add sig child  */
+       sigprocmask(SIG_UNBLOCK, &chld_signal_set, NULL); /* Unblock the signal */
+     }
 
      if ( execvp(argv[1], argv + 1) ) {
        perror("Exec:");
Signature · 4 lines
-- 
Prediction is very difficult, especially of the future. Niels Bohr
Manoj Srivastava   <[email protected]>    <[email protected]> 
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C
#1 lore raw
Quoted 8 lines · Manoj Srivastava

Hi,

This was reported by a Debian user trying to run munin. Since
I forgot to unblock SIGCHLD, his causes weird errors e.g. in perl which apparently assumes that CHLD is not blocked on startup. (and thus breaks libnet-server-perl, used by munin or lrrd).

The following patch is a simple fix.

Thanks, merged.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.