settings: set deprecated 'security' for GetSettings() not to break old clients

Old clients might expect 802-11-wireless.security being set for secured Wi-Fi
connections. So to be on a safer side, we set the property in D-Bus GetSettings()
result.
This commit is contained in:
Jiří Klimeš 2013-08-30 12:12:38 +02:00
parent 0185e8371f
commit ea78744555

View file

@ -1152,6 +1152,18 @@ get_settings_auth_cb (NMSettingsConnection *self,
g_slist_free_full (bssid_list, g_free);
}
/* 802-11-wireless.security property is deprecated. But we set it here so that
* we don't disturb old clients that might expect it being properly set for
* secured Wi-Fi connections.
*/
if (nm_connection_get_setting_wireless_security (NM_CONNECTION (dupl_con))) {
s_wifi = nm_connection_get_setting_wireless (NM_CONNECTION (dupl_con));
g_assert (s_wifi);
g_object_set (s_wifi,
NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NULL);
}
/* Secrets should *never* be returned by the GetSettings method, they
* get returned by the GetSecrets method which can be better
* protected against leakage of secrets to unprivileged callers.