summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-07-15 17:30:09 +0000
committerLubomir Rintel <lkundrak@v3.sk>2019-07-15 20:06:07 +0200
commit2ce6d37c239cc547359ce8c192218dceb88d21b6 (patch)
tree34daf04d22d7be5dcbdac6d4f166a633cc14fe30
parent9ae8a794574a7ebe50d87998668015718b106dd6 (diff)
downloadNetworkManager-lr/dispatcher-path.tar.gz
dispatcher: tolerate lack of connection pathlr/dispatcher-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.
-rw-r--r--dispatcher/nm-dispatcher-utils.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/dispatcher/nm-dispatcher-utils.c b/dispatcher/nm-dispatcher-utils.c
index c09b8c8a1a..d9e7b32b6a 100644
--- a/dispatcher/nm-dispatcher-utils.c
+++ b/dispatcher/nm-dispatcher-utils.c
@@ -490,12 +490,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");