[uClibc] [uClibc 0000195]: syslog.c does not use the facility setwith openlog

Peter Kjellerstedt peter.kjellerstedt at axis.com
Wed Apr 6 09:28:45 UTC 2005


Unless anyone objects (and that would have to be for one heck of a
reason), I will revert the r8701 commit reinstating the missing lines 
indicated in the report below. Without this, everything that does not 
explicitly state a facility in the call to syslog(), i.e., just about 
anything, will be logged using the kern facility rather than the 
expected facility specified with openlog() (or user if none has been 
specified)...

//Peter

> -----Original Message-----
> From: uclibc-bounces at uclibc.org 
> [mailto:uclibc-bounces at uclibc.org] On Behalf Of bugs at busybox.net
> Sent: Monday, March 28, 2005 21:47
> To: uclibc at uclibc.org
> Subject: [uClibc] [uClibc 0000195]: syslog.c does not use the 
> facility setwith openlog
> 
> The following issue has been SUBMITTED.
> ======================================================================
> <http://busybox.net/bugs/view.php?id=195> 
> ======================================================================
> Reported By:                cbachman
> Assigned To:                uClibc
> ======================================================================
> Project:                    uClibc
> Issue ID:                   195
> Category:                   Standards Compliance
> Reproducibility:            always
> Severity:                   minor
> Priority:                   normal
> Status:                     assigned
> ======================================================================
> Date Submitted:             03-28-2005 11:46 PST
> Last Modified:              03-28-2005 11:46 PST
> ======================================================================
> Summary:                    syslog.c does not use the 
> facility set with openlog
> Description: 
> On Tue Apr 6 2004, there were several lines removed from 
> syslog.c because:
> 
>   Fix a bug noticed by Oleg I. Vdovikin, oleg at cs dot msu dot su.
>   This code in uClibc would attempt to set the default facility if
>   none was specified.  Except none being specified is 0, which is
>   also LOG_KERN, therefore klogd could never get kernel messages
>   logged as LOG_KERN.
> 
> While the above might fix the case listed, it breaks standard
> functionality with 
> the openlog call.  Here's what Solaris/NetBSD say about the 
> openlog call:
> 
>      The facility argument  encodes  a  default  facility  to  be
>      assigned to all messages that do not have an explicit facil-
>      ity  already  encoded.   The  initial  default  facility  is
>      LOG_USER.
> 
> In short, the "bug" is expected behavior.  If a program 
> wishes to log as kern then it should call openlog with the 
> facility set to kern. In order to reset LogFacility to LOG_KERN 
> instead of LOG_USER.  Yes, this is ugly, but it appears to be 
> the standard.
> 
> btw, for more discussion on this see: 
> 
> http://sources.redhat.com/ml/libc-alpha/2000-03/msg00060.html
> 
> The current release of glibc follows this "standard" and 
> contains the lines that were removed.
> 
> ======================================================================
> 
> Issue History
> Date Modified  Username       Field                    Change 
>              
> ======================================================================
> 03-28-05 11:46 cbachman       New Issue                       
>              
> ======================================================================



More information about the uClibc mailing list