From fdbf696f22894304e6f4313edaa57464cfdc5c95 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 29 Mar 2018 10:57:51 +0200 Subject: [PATCH] settings: clear connection path when unexporting from D-Bus At that point, the path becomes meaningless. Clear it. --- src/settings/nm-settings.c | 4 +++- src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index c0a474c297..d335850a92 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -904,8 +904,10 @@ connection_removed (NMSettingsConnection *connection, gpointer user_data) /* Re-emit for listeners like NMPolicy */ _notify (self, PROP_CONNECTIONS); - if (nm_dbus_object_is_exported (NM_DBUS_OBJECT (connection))) + if (nm_dbus_object_is_exported (NM_DBUS_OBJECT (connection))) { + nm_connection_set_path (NM_CONNECTION (connection), NULL); nm_dbus_object_unexport (NM_DBUS_OBJECT (connection)); + } check_startup_complete (self); } diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c index bc0ad448af..5a8778ba2f 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c @@ -334,9 +334,6 @@ update_connection (SettingsPluginIfcfg *self, * been removed. */ nm_settings_connection_signal_remove (NM_SETTINGS_CONNECTION (connection_by_uuid)); - /* Remove the path so that claim_connection() doesn't complain later when - * interface gets managed and connection is re-added. */ - nm_connection_set_path (NM_CONNECTION (connection_by_uuid), NULL); /* signal_remove() will end up removing the connection from our hash, * so add it back now.