summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas François <nicolas.francois@centraliens.net>2013-08-21 00:50:09 +0200
committerNicolas François <nicolas.francois@centraliens.net>2013-08-21 00:51:21 +0200
commitad1ecc897b4168f36ef0cb048ebea101015521c8 (patch)
treec3f8c1f82ee65f3f66306bd9c5e2e852a06ebc95
parent1e54da26512fef3f1ebe075bfb4dc9bdbba4bf76 (diff)
Suspend su with the signal which stopped the childsu-c_tty
* src/su.c: Suspend su with the signal which stopped the child instead of always SIGSTOP.
-rw-r--r--ChangeLog5
-rw-r--r--src/su.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0083e807..920fb086 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-21 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/su.c: Suspend su with the signal which stopped the child
+ instead of always SIGSTOP.
+
2013-08-20 Nicolas François <nicolas.francois@centraliens.net>
* src/su.c: call handle_session() before changing the UID so that
diff --git a/src/su.c b/src/su.c
index 3dd19951..34f67712 100644
--- a/src/su.c
+++ b/src/su.c
@@ -477,7 +477,7 @@ static void handle_session (const struct passwd *pw)
&& (0 != WIFSTOPPED (status))) {
/* The child (shell) was suspended.
* Suspend su. */
- kill (getpid (), SIGSTOP);
+ kill (getpid (), WSTOPSIG (status));
/* wake child when resumed */
kill (pid, SIGCONT);
stop = false;