On Sun, Jul 21, 2002 at 04:21:30AM -0700, David Xu wrote:
> I knew the bug, is this patch works for you?
No, it doesn't fix chpass or su, but it does fix ftp.
I don't know why, but this patch seems to fix su with sh/ksh/csh. It might
be useful in tracking down the kernel bug.
--- su.c.old Mon Jul 22 10:22:48 2002
+++ su.c Mon Jul 22 10:23:52 2002
@@ -133,6 +133,7 @@
const char *p, *user, *shell, *mytty, **nargv;
struct sigaction sa, sa_int, sa_quit, sa_tstp;
+ sigset_t sset;
shell = class = cleanenv = NULL;
asme = asthem = fastlogin = statusp = 0;
@@ -316,12 +317,8 @@
* We must fork() before setuid() because we need to call
* pam_setcred(pamh, PAM_DELETE_CRED) as root.
*/
- sa.sa_flags = SA_RESTART;
- sa.__sigaction_u.__sa_handler = SIG_IGN;
- sigemptyset(&sa.sa_mask);
- sigaction(SIGINT, &sa, &sa_int);
- sigaction(SIGQUIT, &sa, &sa_quit);
- sigaction(SIGTSTP, &sa, &sa_tstp);
+ sigfillset(&sset);
+ sigprocmask(SIG_BLOCK, &sset, NULL);
statusp = 1;
child_pid = fork();
@@ -345,9 +342,7 @@
PAM_END();
exit(1);
case 0:
- sigaction(SIGINT, &sa_int, NULL);
- sigaction(SIGQUIT, &sa_quit, NULL);
- sigaction(SIGTSTP, &sa_tstp, NULL);
+ sigprocmask(SIG_UNBLOCK, &sset, NULL);
/*
* Set all user context except for: Environmental variables
* Umask Login records (wtmp, etc) Path
Tim
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message