rpms/tcp_wrappers/devel tcp_wrappers-7.6-sigchld.patch, NONE, 1.1 tcp_wrappers.spec, 1.25, 1.26

Tomas Janousek (tjanouse) fedora-extras-commits at redhat.com
Fri May 25 12:56:18 UTC 2007


Author: tjanouse

Update of /cvs/pkgs/rpms/tcp_wrappers/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3181

Modified Files:
	tcp_wrappers.spec 
Added Files:
	tcp_wrappers-7.6-sigchld.patch 
Log Message:
* Fri May 25 2007 Tomas Janousek <tjanouse at redhat.com> - 7.6-45
- Unblock and catch SIGCHLD from spawned shell commands, fixes #112975


tcp_wrappers-7.6-sigchld.patch:

--- NEW FILE tcp_wrappers-7.6-sigchld.patch ---
--- tcp_wrappers_7.6/shell_cmd.c.sigchld	1994-12-28 17:42:44.000000000 +0100
+++ tcp_wrappers_7.6/shell_cmd.c	2007-05-25 14:28:33.000000000 +0200
@@ -31,6 +31,10 @@
 
 static void do_child();
 
+/* Dummy handler */
+
+static void sigchld(int sig) {}
+
 /* shell_cmd - execute shell command */
 
 void    shell_cmd(command)
@@ -39,6 +43,22 @@
     int     child_pid;
     int     wait_pid;
 
+    struct sigaction new_action, old_action;
+    sigset_t new_mask, old_mask;
+
+    new_action.sa_handler = &sigchld;
+    new_action.sa_flags = 0;
+    sigemptyset(&new_action.sa_mask);
+    sigemptyset(&new_mask);
+    sigaddset(&new_mask, SIGCHLD);
+
+    /*
+     * Ignore the SIGCHLD signal a unblock it so that the program should not
+     * see it.
+     */
+    sigaction(SIGCHLD, &new_action, &old_action);
+    sigprocmask(SIG_UNBLOCK, &new_mask, &old_mask);
+
     /*
      * Most of the work is done within the child process, to minimize the
      * risk of damage to the parent.
@@ -55,6 +75,12 @@
 	while ((wait_pid = wait((int *) 0)) != -1 && wait_pid != child_pid)
 	     /* void */ ;
     }
+
+    /*
+     * Revert the signal mask and the SIGCHLD handler.
+     */
+    sigprocmask(SIG_SETMASK, &old_mask, 0);
+    sigaction(SIGCHLD, &old_action, 0);
 }
 
 /* do_child - exec command with { stdin, stdout, stderr } to /dev/null */


Index: tcp_wrappers.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tcp_wrappers/devel/tcp_wrappers.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- tcp_wrappers.spec	16 Apr 2007 10:54:34 -0000	1.25
+++ tcp_wrappers.spec	25 May 2007 12:55:41 -0000	1.26
@@ -1,7 +1,7 @@
 Summary: A security tool which acts as a wrapper for TCP daemons.
 Name: tcp_wrappers
 Version: 7.6
-Release: 44%{?dist}
+Release: 45%{?dist}
 
 %define LIB_MAJOR 0
 %define LIB_MINOR 7
@@ -30,6 +30,7 @@
 Patch17: tcp_wrappers-7.6-220015.patch
 Patch18: tcp_wrappers-7.6-restore_sigalarm.patch
 Patch19: tcp_wrappers-7.6-siglongjmp.patch
+Patch20: tcp_wrappers-7.6-sigchld.patch
 # required by sin_scope_id in ipv6 patch
 BuildRequires: glibc-devel >= 2.2		
 BuildRoot: %{_tmppath}/%{name}-root
@@ -85,6 +86,7 @@
 %patch17 -p1 -b .220015
 %patch18 -p1 -b .restore_sigalarm
 %patch19 -p1 -b .siglongjmp
+%patch20 -p1 -b .sigchld
 
 %build
 make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIC -DPIC -D_REENTRANT -DHAVE_STRERROR" LDFLAGS="-pie" MAJOR=%{LIB_MAJOR} MINOR=%{LIB_MINOR} REL=%{LIB_REL} linux
@@ -141,6 +143,9 @@
 %{_mandir}/man3/*
 
 %changelog
+* Fri May 25 2007 Tomas Janousek <tjanouse at redhat.com> - 7.6-45
+- Unblock and catch SIGCHLD from spawned shell commands, fixes #112975
+
 * Mon Apr 16 2007 Tomas Janousek <tjanouse at redhat.com> - 7.6-44
 - added restore_sigalarm and siglongjmp patches from Debian, fixes #205129
 




More information about the fedora-extras-commits mailing list