[Pkg-shadow-commits] r1981 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun May 18 13:41:58 UTC 2008


Author: nekral-guest
Date: 2008-05-18 13:41:56 +0000 (Sun, 18 May 2008)
New Revision: 1981

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/src/newgrp.c
   upstream/trunk/src/su.c
   upstream/trunk/src/vipw.c
Log:
	* src/vipw.c, src/su.c, src/newgrp.c: Harmonize the children's
	SIGSTOP handling. Raise the signal which stopped the child instead
	of always SIGSTOP.

	Import Debian patch 406_vipw_resume_properly.
	Thanks to Dean Gaudet.
	* NEWS, src/vipw.c: Resume properly after ^Z.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-04-27 00:40:09 UTC (rev 1980)
+++ upstream/trunk/ChangeLog	2008-05-18 13:41:56 UTC (rev 1981)
@@ -1,3 +1,15 @@
+2008-05-18  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* src/vipw.c, src/su.c, src/newgrp.c: Harmonize the children's
+	SIGSTOP handling. Raise the signal which stopped the child instead
+	of always SIGSTOP.
+
+2008-05-18  Nicolas François  <nicolas.francois at centraliens.net>
+
+	Import Debian patch 406_vipw_resume_properly.
+	Thanks to Dean Gaudet.
+	* NEWS, src/vipw.c: Resume properly after ^Z.
+
 2008-04-27  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* lib/getdef.c, lib/lockpw.c, lib/utent.c, lib/sgetgrent.c,

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2008-04-27 00:40:09 UTC (rev 1980)
+++ upstream/trunk/NEWS	2008-05-18 13:41:56 UTC (rev 1981)
@@ -16,6 +16,8 @@
   * If the SULOG_FILE does not exist when an su session is logged, make
     sure the file is created with group root, instead of using the group
     of the caller.
+- vipw
+  * Resume properly after ^Z.
 
 shadow-4.1.0 -> shadow-4.1.1						02-04-2008
 

Modified: upstream/trunk/src/newgrp.c
===================================================================
--- upstream/trunk/src/newgrp.c	2008-04-27 00:40:09 UTC (rev 1980)
+++ upstream/trunk/src/newgrp.c	2008-05-18 13:41:56 UTC (rev 1981)
@@ -294,7 +294,7 @@
 				pid = waitpid (child, &cst, WUNTRACED);
 				if (pid == child && WIFSTOPPED (cst)) {
 					/* stop when child stops */
-					raise (SIGSTOP);
+					kill (getpid (), WSTOPSIG(status));
 					/* wake child when resumed */
 					kill (child, SIGCONT);
 				}

Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c	2008-04-27 00:40:09 UTC (rev 1980)
+++ upstream/trunk/src/su.c	2008-05-18 13:41:56 UTC (rev 1981)
@@ -238,9 +238,11 @@
 
 			pid = waitpid (-1, &status, WUNTRACED);
 
-			if (WIFSTOPPED (status)) {
-				kill (getpid (), SIGSTOP);
-				/* once we get here, we must have resumed */
+			if ((pid != -1) && WIFSTOPPED (status)) {
+				/* The child (shell) was suspended.
+				 * Suspend su. */
+				kill (getpid (), WSTOPSIG(status));
+				/* wake child when resumed */
 				kill (pid, SIGCONT);
 			}
 		} while (WIFSTOPPED (status));

Modified: upstream/trunk/src/vipw.c
===================================================================
--- upstream/trunk/src/vipw.c	2008-04-27 00:40:09 UTC (rev 1980)
+++ upstream/trunk/src/vipw.c	2008-05-18 13:41:56 UTC (rev 1981)
@@ -209,9 +209,12 @@
 
 	for (;;) {
 		pid = waitpid (pid, &status, WUNTRACED);
-		if (WIFSTOPPED (status)) {
-			kill (getpid (), SIGSTOP);
-			kill (getpid (), SIGCONT);
+		if ((pid != -1) && WIFSTOPPED (status)) {
+			/* The child (editor) was suspended.
+			 * Suspend vipw. */
+			kill (getpid (), WSTOPSIG(status));
+			/* wake child when resumed */
+			kill (pid, SIGCONT);
 		} else
 			break;
 	}




More information about the Pkg-shadow-commits mailing list