Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2003 17:04:55 +0800
From:      "David Xu" <davidxu@freebsd.org>
To:        "Bruce Evans" <bde@zeta.org.au>
Cc:        <src-committers@FreeBSD.org>, <cvs-src@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/usr.bin/su su.c
Message-ID:  <000501c2e7ad$48ab2790$f001a8c0@davidw2k>
References:  <200303110010.h2B0ANe3061768@repoman.freebsd.org> <20030311180357.E23929@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

----- Original Message -----=20
From: "Bruce Evans" <bde@zeta.org.au>
To: "David Xu" <davidxu@FreeBSD.org>
Cc: <src-committers@FreeBSD.org>; <cvs-src@FreeBSD.org>; =
<cvs-all@FreeBSD.org>
Sent: Tuesday, March 11, 2003 3:59 PM
Subject: Re: cvs commit: src/usr.bin/su su.c


> On Mon, 10 Mar 2003, David Xu wrote:
>=20
> > davidxu     2003/03/10 16:10:23 PST
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     usr.bin/su           su.c
> >   Log:
> >   Fix long standing job control bug. SIGTSTP shouldn't be ignored.
> >   Special instructions tested:
> >   suspend
> >   stop $$
>=20
> Er, this can't be right, since it removes the initialization of =
sa_tstp
> as a side effect, so sa_tstp is stack garbage when it is used set
> SIGTSTP for the child.  I think it may work because errors for the
> second setting of SIGTSTP are ignored (all errors from sigaction are
> ignored, of course :-(), and SIGTSTP is soon handled correctly by the
> shell, but ignoring SIGTSTP was wrong for the inital su process.
>=20

Unfortunately I had ignored code for child process :(
BTW, The SIGTSTP handler will be reset by execsigs() in kernel,
The garbage sa_tstp is only effective in very short time.

> The bug is actually a shortstanding job control bug.  SIGTSTP started =
being
> ignored in rev.1.53, in at attempt to work around the =
not-so-shortstanding
> PAM bug of gumming up job control by spawning shells instead of =
exec'ing
> them.  su hasn't been PAMmed in RELENG_4, so the bug isn't in any =
usable
> release.
>=20
> >   Revision  Changes    Path
> >   1.64      +0 -1      src/usr.bin/su/su.c
>=20
> Rev.1.53 makes changes of +3 -1 for SIGTSTP.  Backing out all these
> changes would remove the use of stack garbage.  But perhaps SIGTSTP
> should have been set to SIG_DFL instead of SIG_IGN for the initial
> su process, so su doesn't depend on its initial state.  Then restoring
> its initial state for child would be almost as dubious as "restoring"
> stack garbage, so the sa_tstp variable is not needed eithe way.
>=20
> Untested patches relative to relative to an old version:
>=20
<snip>
> ...
> The patches also reduce nearby style bugs and add old code for =
debugging
> this problem.
>=20

Thanks, I will test it, maybe commit if it is OK.

> Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-src" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000501c2e7ad$48ab2790$f001a8c0>