From owner-freebsd-current Sun Jul 21 17:33:10 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9201C37B400 for ; Sun, 21 Jul 2002 17:33:08 -0700 (PDT) Received: from dilbert.robbins.dropbear.id.au (020.a.009.mel.iprimus.net.au [210.50.112.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id C42CE43E3B for ; Sun, 21 Jul 2002 17:33:06 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (5yzyrf7d8x0bqfn0@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.3/8.12.3) with ESMTP id g6M0X0Eu065230; Mon, 22 Jul 2002 10:33:00 +1000 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.3/8.12.3/Submit) id g6M0ViZD065167; Mon, 22 Jul 2002 10:31:44 +1000 (EST) Date: Mon, 22 Jul 2002 10:31:44 +1000 From: Tim Robbins To: David Xu Cc: current@FreeBSD.ORG Subject: Re: suspend bug Message-ID: <20020722103144.A64785@dilbert.robbins.dropbear.id.au> References: <20020721112130.22708.qmail@web20903.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020721112130.22708.qmail@web20903.mail.yahoo.com>; from bsddiy@yahoo.com on Sun, Jul 21, 2002 at 04:21:30AM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message