ifcfg-rh: add wifi protocols only if present in connection file

An empty 802-11-wireless-security.proto is equivalent to
'wpa,rsn'. Previously we added the two protocols when reading the
connection and the variables were missing, with the result that an
empty value would be read as 'wpa,rsn' at the next restart. This is
harmless but makes the two connections appear as different, with bad
effects when 'monitor-connection-files' is enabled.

Ensure that the original value persists after a write/read cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=770907
This commit is contained in:
Beniamino Galvani
2016-09-05 17:00:54 +02:00
parent fae5ecec5a
commit 00c4e7e73a

View File

@@ -3160,14 +3160,6 @@ make_wpa_setting (shvarFile *ifcfg,
if (allow_rsn && svGetValueBoolean (ifcfg, "WPA_ALLOW_WPA2", TRUE)) if (allow_rsn && svGetValueBoolean (ifcfg, "WPA_ALLOW_WPA2", TRUE))
nm_setting_wireless_security_add_proto (wsec, "rsn"); nm_setting_wireless_security_add_proto (wsec, "rsn");
/* If neither WPA_ALLOW_WPA or WPA_ALLOW_WPA2 were present, default
* to both WPA and RSN allowed.
*/
if (!allow_wpa && !allow_rsn && !ieee8021x) {
nm_setting_wireless_security_add_proto (wsec, "wpa");
nm_setting_wireless_security_add_proto (wsec, "rsn");
}
g_free (allow_wpa); g_free (allow_wpa);
g_free (allow_rsn); g_free (allow_rsn);
} }