From 0da5e2e48c617f13e4583d72c2c5a72e4b6e299c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 26 May 2020 15:26:04 +0200 Subject: [PATCH 1/1] ifcfg-rh: fix handling "802-1x.{phase2-,}ca-path" in ifcfg-rh settings plugin https://bugzilla.redhat.com/show_bug.cgi?id=1840210 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/448 (cherry picked from commit b6b6639c7c8fa667b8fcbc310b65d88124fdc260) (cherry picked from commit 67f1da27fe95fbe09999a953558a0b3e4dcfdd69) (cherry picked from commit 7a20dd4dbbd51081b598f4d42254190a03271471) --- src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 8 ++++++++ src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index e01f7344cdfe..9cb21f92ac5b 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -3626,6 +3626,14 @@ next: timeout = svGetValueInt64 (ifcfg, "IEEE_8021X_AUTH_TIMEOUT", 10, 0, G_MAXINT32, 0); g_object_set (s_8021x, NM_SETTING_802_1X_AUTH_TIMEOUT, (int) timeout, NULL); + nm_clear_g_free (&value); + v = svGetValueStr (ifcfg, "IEEE_8021X_CA_PATH", &value); + g_object_set (s_8021x, NM_SETTING_802_1X_CA_PATH, v, NULL); + + nm_clear_g_free (&value); + v = svGetValueStr (ifcfg, "IEEE_8021X_PHASE2_CA_PATH", &value); + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_CA_PATH, v, NULL); + g_object_set (s_8021x, NM_SETTING_802_1X_OPTIONAL, svGetValueBoolean (ifcfg, "IEEE_8021X_OPTIONAL", FALSE), diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index 90a1a2b8f6f9..3afdb2acd14d 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -530,6 +530,11 @@ write_8021x_setting (NMConnection *connection, "IEEE_8021X_OPTIONAL", nm_setting_802_1x_get_optional (s_8021x)); + svSetValue (ifcfg, "IEEE_8021X_CA_PATH", + nm_setting_802_1x_get_ca_path (s_8021x)); + svSetValue (ifcfg, "IEEE_8021X_PHASE2_CA_PATH", + nm_setting_802_1x_get_phase2_ca_path (s_8021x)); + if (!write_8021x_certs (s_8021x, secrets, blobs, FALSE, ifcfg, error)) return FALSE; -- 2.26.2