This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
syslog and LOG_KERN broken
- To: libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>
- Subject: syslog and LOG_KERN broken
- From: Andreas Jaeger <aj at suse dot de>
- Date: 09 Mar 2000 12:33:58 +0100
- Cc: "Dr. Werner Fink" <werner at suse dot de>
I've found some old mails (sorry, Werner) where Werner complains about
a bug in syslog:
He wrote:
> there is a nasty bug in the syslog facility of the
> glibc. If klogd is linked without the syslog.o (defining
> the (v)syslog() and openlog/closlog() functions) the
> glibc is used. With glibc it seems that the LOG facility is
> LOG_USER even if LOG_KERN is set in openlog():
[...]
> ... now ist seems that in /mirror/cvs/data/glibc/misc/syslog.c
> there is a problem in openlog_internal() ...
> static void
> internal_function
> openlog_internal(const char *ident, int logstat, int logfac)
> {
> if (ident != NULL)
> LogTag = ident;
> LogStat = logstat;
> if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
> LogFacility = logfac;
> [...]
>
> in comparision to /mirror/cvs/data/glibc/misc/sys/syslog.h
> (/usr/include/sys/syslog.h) where
>
> /* facility codes */
> #define LOG_KERN (0<<3) /* kernel messages */
> #define LOG_USER (1<<3) /* random user-level messages */
> [...]
>
> is defined ... default of LogFacility is LOG_USER but the
> condition
>
> logfac != 0
>
> makes LOG_KERN unavailable for openlog(). The LogFacility LOG_KERN
> should be allowed for local connections of root processes.
We've got two possibilities:
- give LOG_KERN a value != 0 (shouldn't be a big problem since this
never worked before!)
- Remove the check in openlog_internal (but then the default will be
LOG_KERN instead of LOG_USER)
What do you think?
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de