From cbf5d13584af53c74491fcfb05bf16b5bd6970f7 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 15 Jul 2019 17:30:09 +0000 Subject: [PATCH] dispatcher: tolerate lack of connection path If the dispatcher is being invoked because the connection was removed (e.g. device going down), it doesn't have a path or a filename anymore. Don't abort in such cases. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/205 (cherry picked from commit 0c62445853142e439ff9a276db96170456528ef0) --- dispatcher/nm-dispatcher-utils.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dispatcher/nm-dispatcher-utils.c b/dispatcher/nm-dispatcher-utils.c index f56ba38fd5..69070b03cd 100644 --- a/dispatcher/nm-dispatcher-utils.c +++ b/dispatcher/nm-dispatcher-utils.c @@ -456,12 +456,8 @@ nm_dispatcher_utils_construct_envp (const char *action, goto done; /* Connection properties */ - if (!g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_PATH, "&o", &path)) { - *out_error_message = "Missing or invalid required value " NMD_CONNECTION_PROPS_PATH "!"; - return NULL; - } - - _items_add_key (items, NULL, "CONNECTION_DBUS_PATH", path); + if (g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_PATH, "&o", &path)) + _items_add_key (items, NULL, "CONNECTION_DBUS_PATH", path); if (g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_EXTERNAL, "b", &external) && external) _items_add_str (items, "CONNECTION_EXTERNAL=1");