[6509] in Kerberos

home help back first fref pref prev next nref lref last post

Re: SIGINT in the rlogind child

daemon@ATHENA.MIT.EDU (Scott Schwartz)
Sun Jan 21 06:30:54 1996

To: kerberos@MIT.EDU
Date: 21 Jan 1996 07:07:49 GMT
From: schwartz@galapagos.cse.psu.edu (Scott Schwartz)

hartmans@MIT.EDU (Sam Hartman) writes:
|     Gary> SIGINT is ignored in the client, but the ^C is sent to the
|     Gary> server, where it kills the child.  This kills the session,
|     Gary> and the client reports "Connection Closed".

|     Gary> So I got into krlogind.c and in the child , told it to
|     Gary> ignore any SIGINT signals.
|     Gary> The question: Any reason why this should not be done?

Because that's treating the symptoms, not the real bug.

The real bug is that krlogind, being a daemon, should not have a
controlling tty.  Ditto for login.krb5.  But the kerberos code is
broken in such a way that they share the controlling tty with the one
for shell that krlogind creates for you.  That's why it is getting the
signals in the first place.

You can see this with 'ps ax', which shows a tty name instead of '?'.

| 	This change doesn't hurt, but where it really needs to be
| fixed is in login.c, which sticks around to destroy tickets (although
| this functionality isn't fully implemented).  It was getting the
| sigINT and was being killed, inadvertantly killing the session.  Our
| login currently ignores SIGINT after it forks to run the shell.

Ignore sigint all you want, but make sure that you don't erroneously
acquire a controlling tty.

You could simplify login.krb5 by doing the fork for the lurker the
other way around, so that the shell is the child of krlogind, as in
regular unix, and have the lurker is a grandchild.  That way it can
reliably do a setsid to get rid of the ctty.  You can wait for the
krlogind to die by reading from a prearranged pipe and getting eof
when it goes.  Or use while (getppid() > 1) { sleep(10); ... } to wait
for the shell.

I think the automagic kdestroy is a mistake anyway.  Most of the time
I want to rlogin, start some xterms, and quit the rlogin.  Those
xterms are still running and using the tickets from the rlogin, so
they shouldn't be destroyed.

home help back first fref pref prev next nref lref last post