diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-01-31 18:06:09 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-01-31 19:16:00 +0000 |
commit | 7480dfdb2a8f58279aab77edab85e1165a2d9120 (patch) | |
tree | d9da4e7875460b0dfd02b085dc82446be12fde0b /bus | |
parent | 4d93cc858c3ecc70ae6704fb6e4b68dc9af5420a (diff) | |
download | dbus-7480dfdb2a8f58279aab77edab85e1165a2d9120.tar.gz |
If a file included via <includedir/> 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 <walters@verbum.org>
Diffstat (limited to 'bus')
-rw-r--r-- | bus/config-parser.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bus/config-parser.c b/bus/config-parser.c index f128b91d..dd941e35 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); + } } } |