[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: xfstt 0.9.99 uploaded - some news with it

On Wed, Apr 28, 1999 at 12:40:18PM -0400, shaleh@clifford.livenet.net wrote:
> > 
> > This version now does NOT run as root. Well..it starts as root...and 
> > the main aplication runs as root (to unlink its pid file)...but 
> > as soon as it fork()s ...the children setuid. The user to setuid to
> > is specified on the command line (if not specified then it defaults
> > to the user that it is already running as)
> > 
> So if started during the boot process it remains root?  maybe it should beome
> daemon or one of the other nobody accounts.

The MAIN process runs as root. This is because if it recieves a kill signal
it needs to clean up its pid file. Can't do that if it was not root (not
without the permissions on /var/run changeing)

However ALL that process does (after initilization) is sit around and
wait for connections. After it connects, it forks and the child 
setuids (and the parent closes the file descripter and never reads 
from thesocket again)

Basically...the entire time it is intercting with users...it is running
as nobody. It was the best way I could come up with doing it. Better
ideas are apreciated.

This leaves a VERY tiny window for possible exploitation...I will be examining
that "window" and seeing if I can perhaps move the fork call (and the setuid) 
to eliminate the window. (ill check the code but I don't think it reads 
much if anything before the fork() )


/* -- Stephen Carpenter <sjc@delphi.com> --- <sjc@debian.org>------------ */
Immature poets imitate, mature poets steal.
                -- T.S. Eliot, "Philip Massinger"

Reply to: