From ad1ecc897b4168f36ef0cb048ebea101015521c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20Fran=C3=A7ois?= Date: Wed, 21 Aug 2013 00:50:09 +0200 Subject: [PATCH] Suspend su with the signal which stopped the child * src/su.c: Suspend su with the signal which stopped the child instead of always SIGSTOP. --- ChangeLog | 5 +++++ src/su.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0083e807e..920fb0868 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-08-21 Nicolas François + + * src/su.c: Suspend su with the signal which stopped the child + instead of always SIGSTOP. + 2013-08-20 Nicolas François * src/su.c: call handle_session() before changing the UID so that diff --git a/src/su.c b/src/su.c index 3dd199512..34f677122 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; -- 2.47.2