From: Simon McVittie Date: Mon, 31 Jan 2011 18:06:09 +0000 (+0000) Subject: If a file included via is invalid, syslog and skip it X-Git-Tag: dbus-1.4.4~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7480dfdb2a8f58279aab77edab85e1165a2d9120;p=thirdparty%2Fdbus.git If a file included via is invalid, syslog and skip it This is more graceful than failing entirely (our previous behaviour), but more visible than ignoring it completely (the previous behaviour patched in by Debian and derivatives). Based on a patch from Daniel Silverstone back in 2004, which was meant to be temporary; I think it makes sense to change this permanently, since files in *.d are typically supplied by other packages, whose bugs shouldn't be able to bring down dbus-daemon. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19186 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230231 Reviewed-by: Colin Walters --- diff --git a/bus/config-parser.c b/bus/config-parser.c index f128b91d1..dd941e351 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -2237,8 +2237,19 @@ include_dir (BusConfigParser *parser, { if (!include_file (parser, &full_path, TRUE, error)) { - _dbus_string_free (&full_path); - goto failed; + if (dbus_error_is_set (error)) + { + /* We log to syslog unconditionally here, because this is + * the configuration parser, so we don't yet know whether + * this bus is going to want to write to syslog! (There's + * also some layer inversion going on, if we want to use + * the bus context.) */ + _dbus_system_log (DBUS_SYSTEM_LOG_INFO, + "Encountered error '%s' while parsing '%s'\n", + error->message, + _dbus_string_get_const_data (&full_path)); + dbus_error_free (error); + } } }