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

system/2178: rwhod sends errors to stderr after calling daemon




>Number:         2178
>Category:       system
>Synopsis:       rwhod sends errors to stderr after calling daemon
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 14 14:30:01 MST 2001
>Last-Modified:
>Originator:     Janjaap van Velthooven
>Organization:
net
>Release:        current
>Environment:
	
	System      : OpenBSD 3.0
	Architecture: OpenBSD.sparc
	Machine     : sparc
>Description:
        after calling daemon(1, 0) rwhod has one diagnostic message 
	sent to stderr which has been closed so noone will ever
	see the message if and when the problem occurs
	
>How-To-Repeat:
	
	look at code (usr.sbin/rwhod/rwhod.c):
...
     160         if (!debug)
     161                 daemon(1, 0);
     162 
     163         if (chdir(_PATH_RWHODIR) < 0) {
     164                 (void)fprintf(stderr, "rwhod: %s: %s\n",
     165                     _PATH_RWHODIR, strerror(errno));
     166                 exit(1);
     167         }
...

>Fix:
	either move the call to daemon beyond the followinbg block
	or syslog the message.
	

>Audit-Trail:
>Unformatted: