From b6e9e6246e9dff41973cec932ae5fadf6e2818aa Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 13 Feb 2017 20:58:51 +0000 Subject: [PATCH 04/11] config-parser: Add transient service directories For configuration purposes these are treated as part of the standard session service directories, to avoid having to add new configuration syntax which would prevent an old dbus-daemon from reloading successfully. From an API perspective, they're separate, though. Signed-off-by: Simon McVittie --- bus/config-parser.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/bus/config-parser.c b/bus/config-parser.c index 35736ef4..ac31a38a 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -821,9 +821,9 @@ start_busconfig_child (BusConfigParser *parser, } else if (element_type == ELEMENT_STANDARD_SESSION_SERVICEDIRS) { + DBusError local_error = DBUS_ERROR_INIT; + DBusList *dirs = NULL; DBusList *link; - DBusList *dirs; - dirs = NULL; if (!check_no_attributes (parser, "standard_session_servicedirs", attribute_names, attribute_values, error)) return FALSE; @@ -834,6 +834,22 @@ start_busconfig_child (BusConfigParser *parser, return FALSE; } + if (_dbus_set_up_transient_session_servicedirs (&dirs, &local_error)) + { + while ((link = _dbus_list_pop_first_link (&dirs))) + service_dirs_append_link_unique_or_free (&parser->service_dirs, + link); + } + else + { + /* Failing to set these up isn't fatal */ + _dbus_warn ("Unable to set up transient service directory: %s", + local_error.message); + dbus_error_free (&local_error); + } + + _dbus_assert (dirs == NULL); + if (!_dbus_get_standard_session_servicedirs (&dirs)) { BUS_SET_OOM (error); @@ -843,6 +859,8 @@ start_busconfig_child (BusConfigParser *parser, while ((link = _dbus_list_pop_first_link (&dirs))) service_dirs_append_link_unique_or_free (&parser->service_dirs, link); + _dbus_assert (dirs == NULL); + return TRUE; } else if (element_type == ELEMENT_STANDARD_SYSTEM_SERVICEDIRS) -- 2.11.0