summaryrefslogtreecommitdiffstats
path: root/usr.bin/su
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-03-11 09:16:51 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-03-11 09:16:51 +0000
commit59af771a3ec62e588d7942e618c0099799760648 (patch)
tree04f52a83bf71ade61255bea2398a8d20e8a9be59 /usr.bin/su
parent7808f3fb4f033edb19828d0347aed2b53dd323b7 (diff)
downloadFreeBSD-src-59af771a3ec62e588d7942e618c0099799760648.zip
FreeBSD-src-59af771a3ec62e588d7942e618c0099799760648.tar.gz
Reset SIGTSTP handler to default both for parent and child process.
Submitted by: bde
Diffstat (limited to 'usr.bin/su')
-rw-r--r--usr.bin/su/su.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index adad750..3b03bb6 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -131,7 +131,7 @@ main(int argc, char *argv[])
char *username, *cleanenv, *class, shellbuf[MAXPATHLEN];
const char *p, *user, *shell, *mytty, **nargv;
- struct sigaction sa, sa_int, sa_quit, sa_tstp;
+ struct sigaction sa, sa_int, sa_quit;
shell = class = cleanenv = NULL;
asme = asthem = fastlogin = statusp = 0;
@@ -327,7 +327,9 @@ main(int argc, char *argv[])
sigemptyset(&sa.sa_mask);
sigaction(SIGINT, &sa, &sa_int);
sigaction(SIGQUIT, &sa, &sa_quit);
-
+ sa.sa_handler = SIG_DFL;
+ sigaction(SIGTSTP, &sa, NULL);
+
statusp = 1;
child_pid = fork();
switch (child_pid) {
@@ -356,7 +358,6 @@ main(int argc, char *argv[])
case 0:
sigaction(SIGINT, &sa_int, NULL);
sigaction(SIGQUIT, &sa_quit, NULL);
- sigaction(SIGTSTP, &sa_tstp, NULL);
/*
* Set all user context except for: Environmental variables
* Umask Login records (wtmp, etc) Path
OpenPOWER on IntegriCloud