Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix-wizards Subject: Re: Conventional daemons Message-ID: <6636@utzoo.UUCP> Date: Mon, 28-Apr-86 13:41:32 EDT Article-I.D.: utzoo.6636 Posted: Mon Apr 28 13:41:32 1986 Date-Received: Mon, 28-Apr-86 13:41:32 EDT References: <2177@brl-smoke.ARPA> Organization: U of Toronto Zoology Lines: 15 > [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