Conventional daemons

Henry Spencer henry at utzoo.UUCP
Fri May 9 05:34:25 AEST 1986


> > Our daemons open /dev/null for stdin and stdout and a log file for stderr.
> 
> Yes, the arguments about having to open *something* are indeed true.
> But, conceivably (not likely, I'll admit), someone might have removed
> /dev/null.  If your daemons don't check for an error when they open it,
> you'll wind up with file descriptors 0 and 1 unopened, and the same
> setuid security bugs you're trying to avoid.

Our daemons most assuredly check to make sure, not only that the open
succeeded, but that it got the right descriptor.  No competent programmer
in his right mind does an open (or a malloc) without checking the result
for failure.
-- 
Join STRAW: the Society To	Henry Spencer @ U of Toronto Zoology
Revile Ada Wholeheartedly	{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Comp.unix.wizards mailing list