summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2006-01-02 08:51:21 +0000
committerbrian <brian@FreeBSD.org>2006-01-02 08:51:21 +0000
commit9866b0b749093ed5076ca82f4a501174ba8c73d3 (patch)
treeabe55a71288e25092ae97f6c4f002b843c60f271
parent2a326134d0e35fa054037847b1446e8c4b4d61df (diff)
downloadFreeBSD-src-9866b0b749093ed5076ca82f4a501174ba8c73d3.zip
FreeBSD-src-9866b0b749093ed5076ca82f4a501174ba8c73d3.tar.gz
Remove broken code that mucks about with tcsetpgrp() -- even if
su isn't the foreground process. Hopefully this won't break PAM, but I couldn't find any useful information about ache's theory that it will. Specifically, this change fixes the following: # sh # echo $$ # su - root -c id & # echo $$ The PID output changes as su seems to be kill -STOP'ing itself and catching the parent shell in the process. This is especially bad if you add a ``su - user -c command &'' to an rc script! Sponsored by: Sophos/Activestate Not objected to by: des
-rw-r--r--usr.bin/su/su.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index f6e0c86..621c351 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -392,22 +392,15 @@ main(int argc, char *argv[])
sa.sa_handler = SIG_IGN;
sigaction(SIGTTOU, &sa, NULL);
close(fds[0]);
- setpgid(child_pid, child_pid);
- tcsetpgrp(STDERR_FILENO, child_pid);
close(fds[1]);
sigaction(SIGPIPE, &sa_pipe, NULL);
while ((pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) {
if (WIFSTOPPED(statusp)) {
- kill(getpid(), SIGSTOP);
- child_pgrp = getpgid(child_pid);
- tcsetpgrp(1, child_pgrp);
- kill(child_pid, SIGCONT);
statusp = 1;
continue;
}
break;
}
- tcsetpgrp(STDERR_FILENO, getpgrp());
if (pid == -1)
err(1, "waitpid");
PAM_END();
OpenPOWER on IntegriCloud