diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2017-02-21 09:57:54 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-03-24 10:42:37 +0100 |
commit | 1eebc0ca0145d0b7ed1641e9d053ee9065e91ed3 (patch) | |
tree | 49a681feffedc7442acaff38d41dae87e3db8aed | |
parent | dec4423a9d4fd4e9b8b07a12a2f993b37c783ab8 (diff) | |
download | NetworkManager-1eebc0ca0145d0b7ed1641e9d053ee9065e91ed3.tar.gz |
settings-connection: fix Save()
Avoid using new_settings when they are none. Also, don't shortcut when
the connection hasn't been changed -- let the settings plugin decide if
it needs to rewrite the connection.
(cherry picked from commit b47340fd3f70c2636bb5dae56a5310b59b88cf7a)
(cherry picked from commit 58c9a4195935fc7611f5cb1e85157e6e9d54f351)
-rw-r--r-- | src/settings/nm-settings-connection.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 1aab5b8535..d02442c6a3 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -1697,6 +1697,17 @@ update_auth_cb (NMSettingsConnection *self, return; } + if (!info->new_settings) { + /* We're just calling Save(). Just commit the existing connection. */ + if (info->save_to_disk) { + nm_settings_connection_commit_changes (self, + NM_SETTINGS_CONNECTION_COMMIT_REASON_USER_ACTION, + con_update_cb, + info); + } + return; + } + if (!any_secrets_present (info->new_settings)) { /* If the new connection has no secrets, we do not want to remove all * secrets, rather we keep all the existing ones. Do that by merging @@ -1846,11 +1857,7 @@ static void impl_settings_connection_save (NMSettingsConnection *self, GDBusMethodInvocation *context) { - /* Do nothing if the connection is already synced with disk */ - if (nm_settings_connection_get_unsaved (self)) - settings_connection_update_helper (self, context, NULL, TRUE); - else - g_dbus_method_invocation_return_value (context, NULL); + settings_connection_update_helper (self, context, NULL, TRUE); } static void |