From a5e3dbb0e36444b915bc9c4c295a5e1a84d3918e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20Fran=C3=A7ois?= Date: Tue, 13 Aug 2013 19:42:50 +0200 Subject: [PATCH] Reset caught variable when signal is handled by su. * src/su.c: When a SIGTSTP is caught, reset caught to 0. There is no need to kill the child in such case after su is resumed. This remove the "Session terminated, terminating shell... ...terminated." messages in such case. --- ChangeLog | 7 +++++++ src/su.c | 1 + 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index c966957d..4d40562a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-08-13 Nicolas François + + * src/su.c: When a SIGTSTP is caught, reset caught to 0. There is + no need to kill the child in such case after su is resumed. This + remove the "Session terminated, terminating shell... + ...terminated." messages in such case. + 2013-08-13 Nicolas François * man/newgidmap.1.xml: Document the checks performed before diff --git a/src/su.c b/src/su.c index 98ea6de3..43f7dc4b 100644 --- a/src/su.c +++ b/src/su.c @@ -347,6 +347,7 @@ static void prepare_pam_close_session (void) if ( ((pid_t)-1 == pid) && (EINTR == errno) && (SIGTSTP == caught)) { + caught = 0; /* Except for SIGTSTP, which request to * stop the child. * We will SIGSTOP ourself on the next -- 2.50.1