about summary refs log tree commit diff
path: root/src/core/settings/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/settings/plugins')
-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
3 files changed, 24 insertions, 11 deletions
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