Conventional daemons

Henry Spencer henry at utzoo.UUCP
Tue Apr 29 03:41:32 AEST 1986


> [Why do daemons open / as stdin/stdout/stderr?]
> The real question was, why open anything? Surely there's
> nothing functionally useful about opening stdin/stdout on
> "/" and it could be a potential hazard if ported...

You have to open *something*, because innocently writing an error message
to stderr could be a disaster if the program got 2 as the descriptor for
an explicit open of some important file.  This is one way of subverting
setuid programs, in fact.

Our daemons open /dev/null for stdin and stdout and a log file for stderr.
-- 
Support the International
League For The Derision		Henry Spencer @ U of Toronto Zoology
Of User-Friendliness!		{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Comp.unix.wizards mailing list