diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-11-03 23:54:55 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-11-03 23:54:55 +0000 |
commit | 8792262eee4455c710d6cb7401cee1cf414e9746 (patch) | |
tree | 95c5889a6fc8a80e119ae5a276a7c760b920e30d /usr.bin/su | |
parent | cf6dec8a88e37f487b395acc3a935fc94499d78f (diff) | |
download | FreeBSD-src-8792262eee4455c710d6cb7401cee1cf414e9746.zip FreeBSD-src-8792262eee4455c710d6cb7401cee1cf414e9746.tar.gz |
It seems when su executes in a shell scripts, there is a timing race,
sometimes, su will receive a SIGTTOU when parent su tries to set child
su's process group as foreground group, and su will be stopped unexpectly,
ignoring SIGTTOU fixes the problem.
Noticed by: fjoe
Diffstat (limited to 'usr.bin/su')
-rw-r--r-- | usr.bin/su/su.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index dae818f..8eac299 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -359,6 +359,8 @@ main(int argc, char *argv[]) child_pid = fork(); switch (child_pid) { default: + sa.sa_handler = SIG_IGN; + sigaction(SIGTTOU, &sa, NULL); close(fds[0]); setpgid(child_pid, child_pid); tcsetpgrp(1, child_pid); |