* 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.
This commit is contained in:
nekral-guest 2008-05-18 13:41:56 +00:00
parent c7302b61ef
commit 6a17c2b27f
5 changed files with 26 additions and 7 deletions

View File

@ -1,3 +1,15 @@
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> 2008-04-27 Nicolas François <nicolas.francois@centraliens.net>
* lib/getdef.c, lib/lockpw.c, lib/utent.c, lib/sgetgrent.c, * lib/getdef.c, lib/lockpw.c, lib/utent.c, lib/sgetgrent.c,

2
NEWS
View File

@ -16,6 +16,8 @@ shadow-4.1.1 -> shadow-4.1.2 UNRELEASED
* If the SULOG_FILE does not exist when an su session is logged, make * 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 sure the file is created with group root, instead of using the group
of the caller. of the caller.
- vipw
* Resume properly after ^Z.
shadow-4.1.0 -> shadow-4.1.1 02-04-2008 shadow-4.1.0 -> shadow-4.1.1 02-04-2008

View File

@ -294,7 +294,7 @@ static void syslog_sg (const char *name, const char *group)
pid = waitpid (child, &cst, WUNTRACED); pid = waitpid (child, &cst, WUNTRACED);
if (pid == child && WIFSTOPPED (cst)) { if (pid == child && WIFSTOPPED (cst)) {
/* stop when child stops */ /* stop when child stops */
raise (SIGSTOP); kill (getpid (), WSTOPSIG(status));
/* wake child when resumed */ /* wake child when resumed */
kill (child, SIGCONT); kill (child, SIGCONT);
} }

View File

@ -238,9 +238,11 @@ static void run_shell (const char *shellstr, char *args[], int doshell,
pid = waitpid (-1, &status, WUNTRACED); pid = waitpid (-1, &status, WUNTRACED);
if (WIFSTOPPED (status)) { if ((pid != -1) && WIFSTOPPED (status)) {
kill (getpid (), SIGSTOP); /* The child (shell) was suspended.
/* once we get here, we must have resumed */ * Suspend su. */
kill (getpid (), WSTOPSIG(status));
/* wake child when resumed */
kill (pid, SIGCONT); kill (pid, SIGCONT);
} }
} while (WIFSTOPPED (status)); } while (WIFSTOPPED (status));

View File

@ -209,9 +209,12 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void))
for (;;) { for (;;) {
pid = waitpid (pid, &status, WUNTRACED); pid = waitpid (pid, &status, WUNTRACED);
if (WIFSTOPPED (status)) { if ((pid != -1) && WIFSTOPPED (status)) {
kill (getpid (), SIGSTOP); /* The child (editor) was suspended.
kill (getpid (), SIGCONT); * Suspend vipw. */
kill (getpid (), WSTOPSIG(status));
/* wake child when resumed */
kill (pid, SIGCONT);
} else } else
break; break;
} }