summary refs log tree commit diff
path: root/src/core/settings
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-05-04 15:35:24 +0200
committerMichael Biebl <biebl@debian.org>2022-05-04 15:35:24 +0200
commit9959fdb2e8ddd06f2161798ca0a39c77d67c652d (patch)
tree2ce24a336d2b1c5fd5dec3090db312eded6c78ba /src/core/settings
parent8c623dddbdebe354cb94bfc559a5371a14865317 (diff)
New upstream version 1.37.92 upstream/1.37.92
Diffstat (limited to 'src/core/settings')
-rw-r--r--src/core/settings/nm-secret-agent.c2
-rw-r--r--src/core/settings/nm-settings-connection.c43
-rw-r--r--src/core/settings/nm-settings-connection.h1
-rw-r--r--src/core/settings/nm-settings.c88
-rw-r--r--src/core/settings/nm-settings.h3
-rw-r--r--src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c28
-rw-r--r--src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c2
-rw-r--r--src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c5
8 files changed, 144 insertions, 28 deletions
diff --git a/src/core/settings/nm-secret-agent.c b/src/core/settings/nm-secret-agent.c
index b222bd5c..a3df4497 100644
--- a/src/core/settings/nm-secret-agent.c
+++ b/src/core/settings/nm-secret-agent.c
@@ -511,7 +511,7 @@ nm_secret_agent_cancel_call(NMSecretAgent *self, NMSecretAgentCallId *call_id)
             g_variant_new("(os)", call_id->path, call_id->setting_name),
             G_VARIANT_TYPE("()"),
             G_DBUS_CALL_FLAGS_NO_AUTO_START,
-            NM_SHUTDOWN_TIMEOUT_MS,
+            NM_SHUTDOWN_TIMEOUT_1500_MSEC,
             NULL, /* this operation is not cancellable. We rely on the timeout. */
             _call_cancel_cb,
             call_id);
diff --git a/src/core/settings/nm-settings-connection.c b/src/core/settings/nm-settings-connection.c
index 55efaebe..1638efcd 100644
--- a/src/core/settings/nm-settings-connection.c
+++ b/src/core/settings/nm-settings-connection.c
@@ -606,6 +606,7 @@ _secrets_update(NMConnection  *connection,
 
 gboolean
 nm_settings_connection_update(NMSettingsConnection            *self,
+                              const char                      *plugin_name,
                               NMConnection                    *new_connection,
                               NMSettingsConnectionPersistMode  persist_mode,
                               NMSettingsConnectionIntFlags     sett_flags,
@@ -618,6 +619,7 @@ nm_settings_connection_update(NMSettingsConnection            *self,
 
     return nm_settings_update_connection(NM_SETTINGS_CONNECTION_GET_PRIVATE(self)->settings,
                                          self,
+                                         plugin_name,
                                          new_connection,
                                          persist_mode,
                                          sett_flags,
@@ -835,6 +837,7 @@ nm_settings_connection_new_secrets(NMSettingsConnection *self,
 
     if (!nm_settings_connection_update(
             self,
+            NULL,
             new_connection ?: connection,
             NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
             NM_SETTINGS_CONNECTION_INT_FLAGS_NONE,
@@ -980,6 +983,7 @@ get_secrets_done_cb(NMAgentManager              *manager,
     }
     if (!nm_settings_connection_update(
             self,
+            NULL,
             new_connection,
             agent_had_system ? NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP
                              : NM_SETTINGS_CONNECTION_PERSIST_MODE_NO_PERSIST,
@@ -1409,6 +1413,7 @@ typedef struct {
     NMConnection          *new_settings;
     NMSettingsUpdate2Flags flags;
     char                  *audit_args;
+    char                  *plugin_name;
     bool                   is_update2 : 1;
 } UpdateInfo;
 
@@ -1436,6 +1441,7 @@ update_complete(NMSettingsConnection *self, UpdateInfo *info, GError *error)
     g_clear_object(&info->agent_mgr);
     g_clear_object(&info->new_settings);
     g_free(info->audit_args);
+    g_free(info->plugin_name);
     g_slice_free(UpdateInfo, info);
 }
 
@@ -1572,6 +1578,7 @@ update_auth_cb(NMSettingsConnection  *self,
 
     nm_settings_connection_update(
         self,
+        info->plugin_name,
         info->new_settings,
         persist_mode,
         (NM_FLAGS_HAS(info->flags, NM_SETTINGS_UPDATE2_FLAG_VOLATILE)
@@ -1642,6 +1649,7 @@ settings_connection_update(NMSettingsConnection  *self,
                            gboolean               is_update2,
                            GDBusMethodInvocation *context,
                            GVariant              *new_settings,
+                           const char            *plugin_name,
                            NMSettingsUpdate2Flags flags)
 {
     NMSettingsConnectionPrivate *priv    = NM_SETTINGS_CONNECTION_GET_PRIVATE(self);
@@ -1696,6 +1704,7 @@ settings_connection_update(NMSettingsConnection  *self,
     info->subject      = subject;
     info->flags        = flags;
     info->new_settings = tmp;
+    info->plugin_name  = g_strdup(plugin_name);
 
     permission = get_update_modify_permission(nm_settings_connection_get_connection(self),
                                               tmp ?: nm_settings_connection_get_connection(self));
@@ -1724,7 +1733,12 @@ impl_settings_connection_update(NMDBusObject                      *obj,
     gs_unref_variant GVariant *settings = NULL;
 
     g_variant_get(parameters, "(@a{sa{sv}})", &settings);
-    settings_connection_update(self, FALSE, invocation, settings, NM_SETTINGS_UPDATE2_FLAG_TO_DISK);
+    settings_connection_update(self,
+                               FALSE,
+                               invocation,
+                               settings,
+                               NULL,
+                               NM_SETTINGS_UPDATE2_FLAG_TO_DISK);
 }
 
 static void
@@ -1744,6 +1758,7 @@ impl_settings_connection_update_unsaved(NMDBusObject                      *obj,
                                FALSE,
                                invocation,
                                settings,
+                               NULL,
                                NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY);
 }
 
@@ -1758,7 +1773,12 @@ impl_settings_connection_save(NMDBusObject                      *obj,
 {
     NMSettingsConnection *self = NM_SETTINGS_CONNECTION(obj);
 
-    settings_connection_update(self, FALSE, invocation, NULL, NM_SETTINGS_UPDATE2_FLAG_TO_DISK);
+    settings_connection_update(self,
+                               FALSE,
+                               invocation,
+                               NULL,
+                               NULL,
+                               NM_SETTINGS_UPDATE2_FLAG_TO_DISK);
 }
 
 static void
@@ -1770,13 +1790,15 @@ impl_settings_connection_update2(NMDBusObject                      *obj,
                                  GDBusMethodInvocation             *invocation,
                                  GVariant                          *parameters)
 {
-    NMSettingsConnection      *self     = NM_SETTINGS_CONNECTION(obj);
-    gs_unref_variant GVariant *settings = NULL;
-    gs_unref_variant GVariant *args     = NULL;
+    NMSettingsConnection      *self        = NM_SETTINGS_CONNECTION(obj);
+    gs_unref_variant GVariant *settings    = NULL;
+    gs_unref_variant GVariant *args        = NULL;
+    gs_free char              *plugin_name = NULL;
     guint32                    flags_u;
     GError                    *error = NULL;
     GVariantIter               iter;
     const char                *args_name;
+    GVariant                  *args_value;
     NMSettingsUpdate2Flags     flags;
 
     g_variant_get(parameters, "(@a{sa{sv}}u@a{sv})", &settings, &flags_u, &args);
@@ -1812,7 +1834,13 @@ impl_settings_connection_update2(NMDBusObject                      *obj,
     nm_assert(g_variant_is_of_type(args, G_VARIANT_TYPE("a{sv}")));
 
     g_variant_iter_init(&iter, args);
-    while (g_variant_iter_next(&iter, "{&sv}", &args_name, NULL)) {
+    while (g_variant_iter_next(&iter, "{&sv}", &args_name, &args_value)) {
+        if (plugin_name == NULL && nm_streq(args_name, "plugin")
+            && g_variant_is_of_type(args_value, G_VARIANT_TYPE_STRING)) {
+            plugin_name = g_variant_dup_string(args_value, NULL);
+            continue;
+        }
+
         error = g_error_new(NM_SETTINGS_ERROR,
                             NM_SETTINGS_ERROR_INVALID_ARGUMENTS,
                             "Unsupported argument '%s'",
@@ -1821,7 +1849,7 @@ impl_settings_connection_update2(NMDBusObject                      *obj,
         return;
     }
 
-    settings_connection_update(self, TRUE, invocation, settings, flags);
+    settings_connection_update(self, TRUE, invocation, settings, plugin_name, flags);
 }
 
 static void
@@ -2010,6 +2038,7 @@ dbus_clear_secrets_auth_cb(NMSettingsConnection  *self,
 
     if (!nm_settings_connection_update(
             self,
+            NULL,
             connection_cloned,
             NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
             NM_SETTINGS_CONNECTION_INT_FLAGS_NONE,
diff --git a/src/core/settings/nm-settings-connection.h b/src/core/settings/nm-settings-connection.h
index 5f8a22e8..893b0d7b 100644
--- a/src/core/settings/nm-settings-connection.h
+++ b/src/core/settings/nm-settings-connection.h
@@ -240,6 +240,7 @@ nm_settings_connection_has_unmodified_applied_connection(NMSettingsConnection *s
                                                          NMSettingCompareFlags compare_flage);
 
 gboolean nm_settings_connection_update(NMSettingsConnection            *self,
+                                       const char                      *plugin_name,
                                        NMConnection                    *new_connection,
                                        NMSettingsConnectionPersistMode  persist_mode,
                                        NMSettingsConnectionIntFlags     sett_flags,
diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c
index 6619d3e0..1ff66e25 100644
--- a/src/core/settings/nm-settings.c
+++ b/src/core/settings/nm-settings.c
@@ -236,12 +236,16 @@ _sett_conn_entry_get_conn(SettConnEntry *sett_conn_entry)
  * update-connection. If this parameter is omitted, then it's about what happens
  * when adding a new profile (add-connection).
  *
+ * @storage_check_ignore is optional, and if given then it skips this particular
+ * storage.
+ *
  * Returns: the conflicting storage or %NULL if there is none.
  */
 static NMSettingsStorage *
 _sett_conn_entry_storage_find_conflicting_storage(SettConnEntry     *sett_conn_entry,
                                                   NMSettingsPlugin  *target_plugin,
                                                   NMSettingsStorage *storage_check_including,
+                                                  NMSettingsStorage *storage_check_ignore,
                                                   const GSList      *plugins)
 {
     StorageData *sd;
@@ -269,6 +273,12 @@ _sett_conn_entry_storage_find_conflicting_storage(SettConnEntry     *sett_conn_e
             continue;
         }
 
+        if (sd->storage == storage_check_ignore) {
+            /* We ignore this one, because we're in the process of
+             * replacing it. */
+            continue;
+        }
+
         if (sd->storage == storage_check_including) {
             /* ok, the storage is the one we are about to check. All other
              * storages are lower priority, so there is no storage that hides
@@ -557,6 +567,8 @@ _startup_complete_check(NMSettings *self, gint64 now_msec)
         return;
     }
 
+    nm_clear_g_source(&priv->startup_complete_timeout_id);
+
     if (c_list_is_empty(&priv->startup_complete_scd_lst_head))
         goto ready;
 
@@ -592,8 +604,6 @@ next_with_ready:
     }
     c_list_splice(&priv->startup_complete_scd_lst_head, &ready_lst);
 
-    nm_clear_g_source(&priv->startup_complete_timeout_id);
-
     if (scd_not_ready) {
         gint64 timeout_msec;
 
@@ -1463,6 +1473,7 @@ _plugin_connections_reload(NMSettings *self)
 
 static gboolean
 _add_connection_to_first_plugin(NMSettings                  *self,
+                                const char                  *plugin_name,
                                 SettConnEntry               *sett_conn_entry,
                                 NMConnection                *new_connection,
                                 gboolean                     in_memory,
@@ -1471,12 +1482,14 @@ _add_connection_to_first_plugin(NMSettings                  *self,
                                 gboolean                     shadowed_owned,
                                 NMSettingsStorage          **out_new_storage,
                                 NMConnection               **out_new_connection,
+                                NMSettingsStorage           *drop_storage,
                                 GError                     **error)
 {
     NMSettingsPrivate    *priv        = NM_SETTINGS_GET_PRIVATE(self);
     gs_free_error GError *first_error = NULL;
     GSList               *iter;
     const char           *uuid;
+    gboolean              no_plugin = TRUE;
 
     uuid = nm_connection_get_uuid(new_connection);
 
@@ -1493,12 +1506,18 @@ _add_connection_to_first_plugin(NMSettings                  *self,
         gboolean                           success;
         const char                        *filename;
 
+        if (plugin_name && strcmp(plugin_name, nm_settings_plugin_get_plugin_name(plugin))) {
+            /* Not the plugin we're confined to. Ignore. */
+            continue;
+        }
+
         if (!in_memory) {
             NMSettingsStorage *conflicting_storage;
 
             conflicting_storage = _sett_conn_entry_storage_find_conflicting_storage(sett_conn_entry,
                                                                                     plugin,
                                                                                     NULL,
+                                                                                    drop_storage,
                                                                                     priv->plugins);
             if (conflicting_storage) {
                 /* we have a connection provided by a plugin with higher priority than the one
@@ -1545,6 +1564,8 @@ _add_connection_to_first_plugin(NMSettings                  *self,
                                                         &add_error);
         }
 
+        no_plugin = FALSE;
+
         if (!success) {
             _LOGT("add-connection: failed to add %s/'%s': %s",
                   nm_connection_get_uuid(new_connection),
@@ -1588,8 +1609,18 @@ _add_connection_to_first_plugin(NMSettings                  *self,
         return TRUE;
     }
 
-    nm_assert(first_error);
-    g_propagate_error(error, g_steal_pointer(&first_error));
+    if (no_plugin) {
+        nm_assert(plugin_name);
+        nm_assert(!first_error);
+        g_set_error(error,
+                    NM_SETTINGS_ERROR,
+                    NM_SETTINGS_ERROR_INVALID_ARGUMENTS,
+                    "a plugin by the name of '%s' is not available",
+                    plugin_name);
+    } else {
+        nm_assert(first_error);
+        g_propagate_error(error, g_steal_pointer(&first_error));
+    }
     return FALSE;
 }
 
@@ -1704,6 +1735,7 @@ _set_nmmeta_tombstone(NMSettings *self,
  */
 gboolean
 nm_settings_add_connection(NMSettings                     *self,
+                           const char                     *plugin,
                            NMConnection                   *connection,
                            NMSettingsConnectionPersistMode persist_mode,
                            NMSettingsConnectionAddReason   add_reason,
@@ -1800,6 +1832,7 @@ nm_settings_add_connection(NMSettings                     *self,
             sett_conn_entry,
             nm_settings_storage_get_plugin(shadowed_storage),
             shadowed_storage,
+            NULL,
             priv->plugins);
         if (conflicting_storage) {
             /* We cannot add the profile as @shadowed_storage, because there is another, existing storage
@@ -1824,6 +1857,7 @@ again_add_connection:
 
     if (!update_storage) {
         success = _add_connection_to_first_plugin(self,
+                                                  plugin,
                                                   sett_conn_entry,
                                                   connection,
                                                   new_in_memory,
@@ -1832,6 +1866,7 @@ again_add_connection:
                                                   FALSE,
                                                   &new_storage,
                                                   &new_connection,
+                                                  NULL,
                                                   &local);
     } else {
         success = _update_connection_to_plugin(self,
@@ -1948,6 +1983,7 @@ again_delete_tombstone:
 gboolean
 nm_settings_update_connection(NMSettings                      *self,
                               NMSettingsConnection            *sett_conn,
+                              const char                      *plugin_name,
                               NMConnection                    *connection,
                               NMSettingsConnectionPersistMode  persist_mode,
                               NMSettingsConnectionIntFlags     sett_flags,
@@ -2154,8 +2190,9 @@ nm_settings_update_connection(NMSettings                      *self,
         } else if (nm_settings_storage_is_keyfile_lib(cur_storage)) {
             /* the profile is a keyfile in /usr/lib. It cannot be overwritten, we must migrate it
              * from /usr/lib to /etc. */
-        } else
+        } else {
             update_storage = cur_storage;
+        }
 
         if (new_in_memory) {
             if (persist_mode == NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY_ONLY) {
@@ -2174,8 +2211,22 @@ nm_settings_update_connection(NMSettings                      *self,
             }
         }
 
+        if (update_storage && plugin_name) {
+            NMSettingsPlugin *plugin = nm_settings_storage_get_plugin(update_storage);
+
+            if (strcmp(plugin_name, nm_settings_plugin_get_plugin_name(plugin))) {
+                /* We're updating a connection, we're confined to a particular
+                 * plugin, but the connection is currently using a different one.
+                 * We need to migrate. Drop the existing storage and look out for
+                 * a new one. */
+                drop_storage   = update_storage;
+                update_storage = NULL;
+            }
+        }
+
         if (!update_storage) {
             success = _add_connection_to_first_plugin(self,
+                                                      plugin_name,
                                                       sett_conn_entry,
                                                       connection,
                                                       new_in_memory,
@@ -2184,6 +2235,7 @@ nm_settings_update_connection(NMSettings                      *self,
                                                       new_shadowed_owned,
                                                       &new_storage,
                                                       &new_connection,
+                                                      drop_storage,
                                                       &local);
         } else {
             success = _update_connection_to_plugin(self,
@@ -2462,6 +2514,7 @@ pk_add_cb(NMAuthChain *chain, GDBusMethodInvocation *context, gpointer user_data
         nm_assert(NM_IS_CONNECTION(connection));
 
         nm_settings_add_connection(self,
+                                   nm_auth_chain_get_data(chain, "plugin"),
                                    connection,
                                    GPOINTER_TO_UINT(nm_auth_chain_get_data(chain, "persist-mode")),
                                    GPOINTER_TO_UINT(nm_auth_chain_get_data(chain, "add-reason")),
@@ -2489,6 +2542,7 @@ pk_add_cb(NMAuthChain *chain, GDBusMethodInvocation *context, gpointer user_data
 
 void
 nm_settings_add_connection_dbus(NMSettings                     *self,
+                                const char                     *plugin,
                                 NMConnection                   *connection,
                                 NMSettingsConnectionPersistMode persist_mode,
                                 NMSettingsConnectionAddReason   add_reason,
@@ -2549,6 +2603,7 @@ nm_settings_add_connection_dbus(NMSettings                     *self,
     nm_auth_chain_set_data(chain, "persist-mode", GUINT_TO_POINTER(persist_mode), NULL);
     nm_auth_chain_set_data(chain, "add-reason", GUINT_TO_POINTER(add_reason), NULL);
     nm_auth_chain_set_data(chain, "sett-flags", GUINT_TO_POINTER(sett_flags), NULL);
+    nm_auth_chain_set_data(chain, "plugin", g_strdup(plugin), g_free);
     nm_auth_chain_add_call_unsafe(chain, perm, TRUE);
     return;
 
@@ -2601,6 +2656,7 @@ settings_add_connection_helper(NMSettings                   *self,
                                GDBusMethodInvocation        *context,
                                gboolean                      is_add_connection_2,
                                GVariant                     *settings,
+                               const char                   *plugin,
                                NMSettingsAddConnection2Flags flags)
 {
     gs_unref_object NMConnection   *connection = NULL;
@@ -2636,6 +2692,7 @@ settings_add_connection_helper(NMSettings                   *self,
 
     nm_settings_add_connection_dbus(
         self,
+        plugin,
         connection,
         persist_mode,
         NM_FLAGS_HAS(flags, NM_SETTINGS_ADD_CONNECTION2_FLAG_BLOCK_AUTOCONNECT)
@@ -2665,6 +2722,7 @@ impl_settings_add_connection(NMDBusObject                      *obj,
                                    invocation,
                                    FALSE,
                                    settings,
+                                   NULL,
                                    NM_SETTINGS_ADD_CONNECTION2_FLAG_TO_DISK);
 }
 
@@ -2685,6 +2743,7 @@ impl_settings_add_connection_unsaved(NMDBusObject                      *obj,
                                    invocation,
                                    FALSE,
                                    settings,
+                                   NULL,
                                    NM_SETTINGS_ADD_CONNECTION2_FLAG_IN_MEMORY);
 }
 
@@ -2700,8 +2759,10 @@ impl_settings_add_connection2(NMDBusObject                      *obj,
     NMSettings                   *self     = NM_SETTINGS(obj);
     gs_unref_variant GVariant    *settings = NULL;
     gs_unref_variant GVariant    *args     = NULL;
+    gs_free char                 *plugin   = NULL;
     NMSettingsAddConnection2Flags flags;
     const char                   *args_name;
+    GVariant                     *args_value;
     GVariantIter                  iter;
     guint32                       flags_u;
 
@@ -2745,7 +2806,13 @@ impl_settings_add_connection2(NMDBusObject                      *obj,
     nm_assert(g_variant_is_of_type(args, G_VARIANT_TYPE("a{sv}")));
 
     g_variant_iter_init(&iter, args);
-    while (g_variant_iter_next(&iter, "{&sv}", &args_name, NULL)) {
+    while (g_variant_iter_next(&iter, "{&sv}", &args_name, &args_value)) {
+        if (plugin == NULL && nm_streq(args_name, "plugin")
+            && g_variant_is_of_type(args_value, G_VARIANT_TYPE_STRING)) {
+            plugin = g_variant_dup_string(args_value, NULL);
+            continue;
+        }
+
         g_dbus_method_invocation_take_error(invocation,
                                             g_error_new(NM_SETTINGS_ERROR,
                                                         NM_SETTINGS_ERROR_INVALID_ARGUMENTS,
@@ -2754,7 +2821,7 @@ impl_settings_add_connection2(NMDBusObject                      *obj,
         return;
     }
 
-    settings_add_connection_helper(self, invocation, TRUE, settings, flags);
+    settings_add_connection_helper(self, invocation, TRUE, settings, plugin, flags);
 }
 
 /*****************************************************************************/
@@ -3201,8 +3268,10 @@ nm_settings_get_connection_by_path(NMSettings *self, const char *path)
     priv = NM_SETTINGS_GET_PRIVATE(self);
 
     connection =
-        nm_dbus_manager_lookup_object(nm_dbus_object_get_manager(NM_DBUS_OBJECT(self)), path);
-    if (!connection || !NM_IS_SETTINGS_CONNECTION(connection))
+        nm_dbus_manager_lookup_object_with_type(nm_dbus_object_get_manager(NM_DBUS_OBJECT(self)),
+                                                NM_TYPE_SETTINGS_CONNECTION,
+                                                path);
+    if (!connection)
         return NULL;
 
     nm_assert(c_list_contains(&priv->connections_lst_head, &connection->_connections_lst));
@@ -3604,6 +3673,7 @@ device_realized(NMDevice *device, GParamSpec *pspec, NMSettings *self)
           nm_device_get_iface(device));
 
     nm_settings_add_connection(self,
+                               NULL,
                                connection,
                                NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY_ONLY,
                                NM_SETTINGS_CONNECTION_ADD_REASON_NONE,
diff --git a/src/core/settings/nm-settings.h b/src/core/settings/nm-settings.h
index 56cebed0..8747d1dc 100644
--- a/src/core/settings/nm-settings.h
+++ b/src/core/settings/nm-settings.h
@@ -68,6 +68,7 @@ typedef void (*NMSettingsAddCallback)(NMSettings            *settings,
                                       gpointer               user_data);
 
 void nm_settings_add_connection_dbus(NMSettings                     *self,
+                                     const char                     *plugin,
                                      NMConnection                   *connection,
                                      NMSettingsConnectionPersistMode persist_mode,
                                      NMSettingsConnectionAddReason   add_reason,
@@ -90,6 +91,7 @@ NMSettingsConnection **nm_settings_get_connections_clone(NMSettings
                                                          gpointer         sort_data);
 
 gboolean nm_settings_add_connection(NMSettings                     *settings,
+                                    const char                     *plugin,
                                     NMConnection                   *connection,
                                     NMSettingsConnectionPersistMode persist_mode,
                                     NMSettingsConnectionAddReason   add_reason,
@@ -99,6 +101,7 @@ gboolean nm_settings_add_connection(NMSettings                     *settings,
 
 gboolean nm_settings_update_connection(NMSettings                      *self,
                                        NMSettingsConnection            *sett_conn,
+                                       const char                      *plugin_name,
                                        NMConnection                    *new_connection,
                                        NMSettingsConnectionPersistMode  persist_mode,
                                        NMSettingsConnectionIntFlags     sett_flags,
diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
index 48c4cae9..551f2b91 100644
--- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
+++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
@@ -397,7 +397,9 @@ write_8021x_setting(NMConnection *connection,
     if (wired)
         svSetValueStr(ifcfg, "KEY_MGMT", "IEEE8021X");
 
-    /* EAP method */
+    /* EAP method
+     *
+     * FIXME(ifcfg-full-cycle): persist all values of eap-method. */
     if (nm_setting_802_1x_get_num_eap_methods(s_8021x)) {
         value = nm_setting_802_1x_get_eap_method(s_8021x, 0);
         if (value)
@@ -455,11 +457,21 @@ write_8021x_setting(NMConnection *connection,
             value = "allow-auth";
         else if (strcmp(value, "3") == 0)
             value = "allow-unauth allow-auth";
-        else
+        else {
+            /* FIXME(ifcfg-full-cycle): does not handle the value "0". */
             value = NULL;
+        }
     }
     svSetValueStr(ifcfg, "IEEE_8021X_FAST_PROVISIONING", value);
 
+    auth_flags = nm_setting_802_1x_get_phase1_auth_flags(s_8021x);
+    if (auth_flags != NM_SETTING_802_1X_AUTH_FLAGS_NONE) {
+        svSetValueEnum(ifcfg,
+                       "IEEE_8021X_PHASE1_AUTH_FLAGS",
+                       nm_setting_802_1x_auth_flags_get_type(),
+                       auth_flags);
+    }
+
     /* Phase2 auth methods */
     phase2_auth = g_string_new(NULL);
 
@@ -480,14 +492,6 @@ write_8021x_setting(NMConnection *connection,
         g_free(tmp);
     }
 
-    auth_flags = nm_setting_802_1x_get_phase1_auth_flags(s_8021x);
-    if (auth_flags != NM_SETTING_802_1X_AUTH_FLAGS_NONE) {
-        svSetValueEnum(ifcfg,
-                       "IEEE_8021X_PHASE1_AUTH_FLAGS",
-                       nm_setting_802_1x_auth_flags_get_type(),
-                       auth_flags);
-    }
-
     svSetValueStr(ifcfg,
                   "IEEE_8021X_INNER_AUTH_METHODS",
                   phase2_auth->len ? phase2_auth->str : NULL);
@@ -503,6 +507,8 @@ write_8021x_setting(NMConnection *connection,
     str = g_string_new(NULL);
     num = nm_setting_802_1x_get_num_altsubject_matches(s_8021x);
     for (i = 0; i < num; i++) {
+        /* FIXME(ifcfg-full-cycle): this cannot handle values with spaces, which
+         * are not rejected by nm_connection_verify(). */
         if (i > 0)
             g_string_append_c(str, ' ');
         match = nm_setting_802_1x_get_altsubject_match(s_8021x, i);
@@ -515,6 +521,8 @@ write_8021x_setting(NMConnection *connection,
     str = g_string_new(NULL);
     num = nm_setting_802_1x_get_num_phase2_altsubject_matches(s_8021x);
     for (i = 0; i < num; i++) {
+        /* FIXME(ifcfg-full-cycle): this cannot handle values with spaces, which
+         * are not rejected by nm_connection_verify(). */
         if (i > 0)
             g_string_append_c(str, ' ');
         match = nm_setting_802_1x_get_phase2_altsubject_match(s_8021x, i);
diff --git a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
index 7960ea2a..83e48b81 100644
--- a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
+++ b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
@@ -221,6 +221,7 @@ _assert_expected_content(NMConnection *connection, const char *filename, const c
             success = g_file_set_contents(expected, content_written, len_written, &error);
             nmtst_assert_success(success, error);
         } else {
+            NM_PRAGMA_WARNING_DISABLE_DANGLING_POINTER
             g_error(
                 "The content of \"%s\" (%zu) differs from \"%s\" (%zu). Set "
                 "NMTST_IFCFG_RH_UPDATE_EXPECTED=yes (or NM_TEST_REGENERATE=1) to update the files "
@@ -231,6 +232,7 @@ _assert_expected_content(NMConnection *connection, const char *filename, const c
                 len_expectd,
                 content_written,
                 content_expectd);
+            NM_PRAGMA_WARNING_REENABLE
         }
     }
 }
diff --git a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c
index b4c30df7..11a8e416 100644
--- a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c
+++ b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c
@@ -2635,8 +2635,11 @@ _escape_filename(gboolean with_extension, const char *filename, gboolean would_b
     g_assert(esc && esc[0]);
     g_assert(!strchr(esc, '/'));
 
-    if (nm_keyfile_utils_ignore_filename(esc, with_extension))
+    if (nm_keyfile_utils_ignore_filename(esc, with_extension)) {
+        NM_PRAGMA_WARNING_DISABLE_DANGLING_POINTER
         g_error("Escaping filename \"%s\" yielded \"%s\", but this is ignored", filename, esc);
+        NM_PRAGMA_WARNING_REENABLE
+    }
 }
 
 static void