Subject: Re: Warning message: Why do I care?
To: Peter Seebach <seebs@plethora.net>
From: Steven M. Bellovin <smb@research.att.com>
List: current-users
Date: 07/19/2002 10:43:49
In message <200207182039.g6IKdg319641@guild.plethora.net>, Peter Seebach writes
:
>set{u,g}id pid 1699 (df) was invoked by uid 100 ppid 369 (perl) with fd 0 clos
>ed
>
>I have a perl script which runs as a daemon (disconnected from stdin, stdout),
>and which wants to use df.
>
>Why on earth is it bad to do this?  What is this warning trying to warn me of?
>
You should open /dev/null instead.  

There are programs that open files, then write to stdout or stderr, or 
read from stdin.  If those file descriptors are closed, the new files 
might be assigned to 0, 1, or 2 -- so the program might write Bad 
Things to an important file.

		--Steve Bellovin, http://www.research.att.com/~smb (me)
		http://www.wilyhacker.com ("Firewalls" book)