]> granicus.if.org Git - shadow/commitdiff
* src/su.c, src/vipw.c, src/newgrp.c: When the child is
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 23 Mar 2010 13:05:06 +0000 (13:05 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 23 Mar 2010 13:05:06 +0000 (13:05 +0000)
interrupted, stop ourself with a SIGSTOP signal.

ChangeLog
src/newgrp.c
src/su.c
src/vipw.c

index 7db41c6be2c60732f6d2cb54f8b4b91c5da02c55..ac2fda83855fa2d1e630c664e49260cf1b67eb0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-23  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/su.c, src/vipw.c, src/newgrp.c: When the child is
+       interrupted, stop ourself with a SIGSTOP signal.
+
 2010-03-23  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/newgrp.c: Limit the scope of variable pid.
index 167b10bf5fa7f146a5373d7c1bc6a2a846644919..10204c7c656a48d4bb2f6275924861bf74f55c9c 100644 (file)
@@ -322,8 +322,9 @@ static void syslog_sg (const char *name, const char *group)
                                errno = 0;
                                pid = waitpid (child, &cst, WUNTRACED);
                                if ((pid == child) && (WIFSTOPPED (cst) != 0)) {
-                                       /* stop when child stops */
-                                       kill (getpid (), WSTOPSIG(cst));
+                                       /* The child (shell) was suspended.
+                                        * Suspend sg/newgrp. */
+                                       kill (getpid (), SIGSTOP);
                                        /* wake child when resumed */
                                        kill (child, SIGCONT);
                                }
index a0ee6d8d6538c2923bce7232e7a2abc42f1d99b1..837e76c39f8bc536c3b384df54c44a94bf25529f 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -313,7 +313,7 @@ static void run_shell (const char *shellstr, char *args[], bool doshell,
                        if (((pid_t)-1 != pid) && (0 != WIFSTOPPED (status))) {
                                /* The child (shell) was suspended.
                                 * Suspend su. */
-                               kill (getpid (), WSTOPSIG(status));
+                               kill (getpid (), SIGSTOP);
                                /* wake child when resumed */
                                kill (pid, SIGCONT);
                        }
index 81c4b7c7bdc2fd1752064044b98e8863a2381560..d3246e32dab05f5635099b668aa30e4104ffa2d2 100644 (file)
@@ -310,7 +310,7 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void))
                if ((pid != -1) && (WIFSTOPPED (status) != 0)) {
                        /* The child (editor) was suspended.
                         * Suspend vipw. */
-                       kill (getpid (), WSTOPSIG (status));
+                       kill (getpid (), SIGSTOP);
                        /* wake child when resumed */
                        kill (pid, SIGCONT);
                } else {