From: Simon McVittie Date: Tue, 15 Mar 2011 15:42:56 +0000 (+0000) Subject: process_config_first_time_only: initialize syslog as intended. X-Git-Tag: dbus-1.4.10~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9af1526d195f69e1ad794ea181f6b6341285a63;p=thirdparty%2Fdbus.git process_config_first_time_only: initialize syslog as intended. On Linux, we previously called openlog() (with different options!) while initializing SELinux; leave SELinux messages as LOG_USER|LOG_INFO in case anyone was relying on that, but let the rest of our log messages come out as LOG_DAEMON. Also enable LOG_PERROR (copy syslog messages to stderr) unconditionally; we can make this an autoconf check if anyone's pet Unix doesn't have LOG_PERROR. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358 Reviewed-by: Colin Walters --- diff --git a/bus/bus.c b/bus/bus.c index 8b8ff92de..2c911c518 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -297,6 +297,8 @@ process_config_first_time_only (BusContext *context, retval = FALSE; auth_mechanisms = NULL; + _dbus_init_system_log (); + context->systemd_activation = systemd_activation; /* Check for an existing pid file. Of course this is a race; diff --git a/bus/selinux.c b/bus/selinux.c index fe04063a6..e94d8a8e3 100644 --- a/bus/selinux.c +++ b/bus/selinux.c @@ -164,7 +164,7 @@ log_callback (const char *fmt, ...) } #endif /* HAVE_LIBAUDIT */ - vsyslog (LOG_INFO, fmt, ap); + vsyslog (LOG_USER | LOG_INFO, fmt, ap); va_end(ap); } @@ -342,7 +342,6 @@ bus_selinux_full_init (void) } else { - openlog ("dbus", LOG_PERROR, LOG_USER); _dbus_verbose ("Access Vector Cache (AVC) started.\n"); } diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c index ba8ca7f86..a80f6430c 100644 --- a/dbus/dbus-sysdeps-util-unix.c +++ b/dbus/dbus-sysdeps-util-unix.c @@ -425,7 +425,7 @@ _dbus_request_file_descriptor_limit (unsigned int limit) void _dbus_init_system_log (void) { - openlog ("dbus", LOG_PID, LOG_DAEMON); + openlog ("dbus", LOG_PID | LOG_PERROR, LOG_DAEMON); } /** * Log a message to the system log file (e.g. syslog on Unix).