summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-06-26 22:31:30 +0200
committerThomas Haller <thaller@redhat.com>2023-06-29 14:05:27 +0200
commit3d2622c358643243391c4a56f782ea07fa7b0468 (patch)
treef7aac847de026ed76f409a70feb56bb0f82c1e9c
parente5a6e16ce010852db568d5edaf5be481bb43b376 (diff)
settings: fix passing force_rename flag to _update_connection_to_plugin()
No bad effects so far, it was unused. But as it wasn't used, also no longer set the update_reason flag NM_SETTINGS_CONNECTION_UPDATE_REASON_FORCE_RENAME. We didn't have the force-rename behavior so far. This makes the flag totally unused, and maybe should be dropped. It's kept for now, if only to show what could be done.
-rw-r--r--src/core/settings/nm-settings-connection.c7
-rw-r--r--src/core/settings/nm-settings.c21
-rw-r--r--src/core/settings/plugins/keyfile/nms-keyfile-plugin.c2
3 files changed, 16 insertions, 14 deletions
diff --git a/src/core/settings/nm-settings-connection.c b/src/core/settings/nm-settings-connection.c
index 32911f16e4..176cc2c252 100644
--- a/src/core/settings/nm-settings-connection.c
+++ b/src/core/settings/nm-settings-connection.c
@@ -1582,10 +1582,9 @@ update_auth_cb(NMSettingsConnection *self,
: NM_SETTINGS_CONNECTION_INT_FLAGS_NONE),
NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED | NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE
| NM_SETTINGS_CONNECTION_INT_FLAGS_EXTERNAL,
- NM_SETTINGS_CONNECTION_UPDATE_REASON_FORCE_RENAME
- | (NM_FLAGS_HAS(info->flags, NM_SETTINGS_UPDATE2_FLAG_NO_REAPPLY)
- ? NM_SETTINGS_CONNECTION_UPDATE_REASON_NONE
- : NM_SETTINGS_CONNECTION_UPDATE_REASON_REAPPLY_PARTIAL)
+ (NM_FLAGS_HAS(info->flags, NM_SETTINGS_UPDATE2_FLAG_NO_REAPPLY)
+ ? NM_SETTINGS_CONNECTION_UPDATE_REASON_NONE
+ : NM_SETTINGS_CONNECTION_UPDATE_REASON_REAPPLY_PARTIAL)
| NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_SYSTEM_SECRETS
| NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS
| NM_SETTINGS_CONNECTION_UPDATE_REASON_UPDATE_NON_SECRET
diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c
index 49a7c68753..e891e58dfc 100644
--- a/src/core/settings/nm-settings.c
+++ b/src/core/settings/nm-settings.c
@@ -2263,16 +2263,17 @@ nm_settings_update_connection(NMSettings *self,
drop_storage,
&local);
} else {
- success = _update_connection_to_plugin(self,
- update_storage,
- connection,
- new_flags,
- update_reason,
- new_shadowed_storage_filename,
- new_shadowed_owned,
- &new_storage,
- &new_connection,
- &local);
+ success = _update_connection_to_plugin(
+ self,
+ update_storage,
+ connection,
+ new_flags,
+ NM_FLAGS_HAS(update_reason, NM_SETTINGS_CONNECTION_UPDATE_REASON_FORCE_RENAME),
+ new_shadowed_storage_filename,
+ new_shadowed_owned,
+ &new_storage,
+ &new_connection,
+ &local);
}
if (!success) {
gboolean ignore_failure;
diff --git a/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c b/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c
index 65b0243f13..1d48ce19ae 100644
--- a/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c
+++ b/src/core/settings/plugins/keyfile/nms-keyfile-plugin.c
@@ -910,6 +910,8 @@ nms_keyfile_plugin_update_connection(NMSKeyfilePlugin *self,
previous_filename = nms_keyfile_storage_get_filename(storage);
uuid = nms_keyfile_storage_get_uuid(storage);
+ /* FIXME: force_rename is unused so far. */
+
if (!nms_keyfile_writer_connection(
connection,
is_nm_generated,