rpms/sudo/devel sudo-1.6.8p8-sesh-stopsig.patch, NONE, 1.1 sudo.spec, 1.25, 1.26

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Sep 19 17:24:08 UTC 2005


Author: kzak

Update of /cvs/dist/rpms/sudo/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv11682

Modified Files:
	sudo.spec 
Added Files:
	sudo-1.6.8p8-sesh-stopsig.patch 
Log Message:
- fix #162623 - sesh hangs when child suspends

sudo-1.6.8p8-sesh-stopsig.patch:
 sesh.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

--- NEW FILE sudo-1.6.8p8-sesh-stopsig.patch ---
--- sudo-1.6.8p9/sesh.c.sigstop	2005-09-19 17:38:15.000000000 +0200
+++ sudo-1.6.8p9/sesh.c	2005-09-19 17:41:48.000000000 +0200
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <limits.h>
 #include <sys/types.h>
@@ -22,19 +23,33 @@
     int status;
     int ret;
 
-    do {
-      if ((ret = waitpid(pid, &status, 0)) < 0 && errno == EINTR)
+    while (1) {
+      if ((ret = waitpid(pid, &status, WUNTRACED)) < 0 && errno == EINTR)
         continue;
       else if (ret < 0) {
         perror("waitpid failed");
         exit(1);
       }
-    } while (0);
+
+      if (!WIFSTOPPED(status))
+	break;
+
+      /* Reset the handler in case it was inherited ignored,
+	 but the child reset it and stopped anyway.  */
+      signal(WSTOPSIG(status), SIG_DFL);
+      raise(WSTOPSIG(status));
+
+      /* Now we stop until continued ourselves.  */
+      kill(getpgid(pid) == pid ? -pid : pid, SIGCONT);
+    }
 
     if (WIFEXITED(status))
       exit(WEXITSTATUS(status));
+    else if (WIFSIGNALED(status))
+      /* XXX print here like the shell would? */
+      exit(128 + WTERMSIG(status));
     else
-      exit(1);
+      exit(127);		/* Should never happen.  */
   } else {
     /* Child */
     execv(argv[1], &argv[1]);


Index: sudo.spec
===================================================================
RCS file: /cvs/dist/rpms/sudo/devel/sudo.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- sudo.spec	2 Aug 2005 14:39:04 -0000	1.25
+++ sudo.spec	19 Sep 2005 17:24:05 -0000	1.26
@@ -4,7 +4,7 @@
 Summary: Allows restricted root access for specified users.
 Name: sudo
 Version: 1.6.8p9
-Release: 2
+Release: 3
 License: BSD
 Group: Applications/System
 Source: http://www.courtesan.com/sudo/dist/sudo-%{version}.tar.gz
@@ -17,8 +17,10 @@
 BuildRequires: libselinux-devel
 %endif
 
-# 154511 – sudo does not use limits.conf
+# 154511 - sudo does not use limits.conf
 Patch2: sudo-1.6.8p8-pam-sess.patch
+# 162623 - sesh hangs when child suspends
+Patch3: sudo-1.6.8p8-sesh-stopsig.patch
 
 %description
 Sudo (superuser do) allows a system administrator to give certain
@@ -39,6 +41,7 @@
 %endif
 
 %patch2 -p1 -b .sess
+%patch3 -p1 -b .sigstop
 
 %build
 %ifarch s390 s390x
@@ -104,6 +107,9 @@
 /bin/chmod 0440 /etc/sudoers || :
 
 %changelog
+* Mon Sep 19 2005 Karel Zak <kzak at redhat.com> 1.6.8p9-3
+- fix #162623 - sesh hangs when child suspends
+
 * Mon Aug 1 2005 Dan Walsh <dwalsh at redhat.com> 1.6.8p9-2
 - Add back in interfaces call, SELinux has been fixed to work around
 
@@ -111,7 +117,7 @@
 - new version 1.6.8p9 (resolve #161116 - CAN-2005-1993 sudo trusted user arbitrary command execution)
 
 * Tue May 24 2005 Karel Zak <kzak at redhat.com> 1.6.8p8-2
-- fix #154511 – sudo does not use limits.conf
+- fix #154511 - sudo does not use limits.conf
 
 * Mon Apr  4 2005 Thomas Woerner <twoerner at redhat.com> 1.6.8p8-1
 - new version 1.6.8p8: new sudoedit and sudo_noexec




More information about the fedora-cvs-commits mailing list