+2008-05-18 Nicolas François <nicolas.francois@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@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@centraliens.net>
* lib/getdef.c, lib/lockpw.c, lib/utent.c, lib/sgetgrent.c,
* 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
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);
}
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));
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;
}