core: don't use deprecated 'security' property of wifi setting

That means replacing/removing
- nm_setting_wireless_get_security() function
- NM_SETTING_WIRELESS_SEC property
This commit is contained in:
Jiří Klimeš
2013-08-27 13:13:23 +01:00
parent 36465df124
commit 713755780f
9 changed files with 9 additions and 31 deletions

View File

@@ -307,7 +307,7 @@ nm_utils_get_shared_wifi_permission (NMConnection *connection)
s_wifi = nm_connection_get_setting_wireless (connection);
if (s_wifi) {
s_wsec = nm_connection_get_setting_wireless_security (connection);
if (nm_setting_wireless_get_security (s_wifi) || s_wsec)
if (s_wsec)
return NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED;
else
return NM_AUTH_PERMISSION_WIFI_SHARE_OPEN;

View File

@@ -3001,7 +3001,7 @@ act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason)
}
/* have secrets, or no secrets required */
if (nm_setting_wireless_get_security (s_wireless)) {
if (nm_connection_get_setting_wireless_security (connection)) {
nm_log_info (LOGD_DEVICE | LOGD_WIFI,
"Activation (%s/wireless): connection '%s' has security"
", and secrets exist. No new secrets needed.",

View File

@@ -547,7 +547,7 @@ nm_ap_utils_complete_connection (const GByteArray *ap_ssid,
&& (ap_wpa_flags == NM_802_11_AP_SEC_NONE)
&& (ap_rsn_flags == NM_802_11_AP_SEC_NONE)) {
/* Make sure the connection doesn't specify security */
if (nm_setting_wireless_get_security (s_wifi) || s_wsec || s_8021x) {
if (s_wsec || s_8021x) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_SECURITY_ERROR,
NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
@@ -558,9 +558,6 @@ nm_ap_utils_complete_connection (const GByteArray *ap_ssid,
}
/* Everything else requires security */
g_object_set (G_OBJECT (s_wifi),
NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NULL);
if (!s_wsec) {
s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
nm_connection_add_setting (connection, NM_SETTING (s_wsec));

View File

@@ -3285,9 +3285,6 @@ wireless_connection_from_ifcfg (const char *file,
nm_connection_add_setting (connection, security_setting);
if (s_8021x)
nm_connection_add_setting (connection, NM_SETTING (s_8021x));
g_object_set (wireless_setting, NM_SETTING_WIRELESS_SEC,
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL);
}
}

View File

@@ -911,7 +911,7 @@ write_wireless_setting (NMConnection *connection,
svSetValue (ifcfg, "DEFAULTKEY", NULL, FALSE);
svSetValue (ifcfg, "SECURITYMODE", NULL, FALSE);
if (nm_setting_wireless_get_security (s_wireless)) {
if (nm_connection_get_setting_wireless_security (connection)) {
if (!write_wireless_security_setting (connection, ifcfg, adhoc, no_8021x, error))
return FALSE;
} else {

View File

@@ -1721,15 +1721,9 @@ ifnet_update_connection_from_config_block (const char *conn_name,
/* wireless security setting */
wsec = make_wireless_security_setting (conn_name, basepath, &s_8021x, error);
if (wsec) {
nm_connection_add_setting (connection,
NM_SETTING (wsec));
nm_connection_add_setting (connection, NM_SETTING (wsec));
if (s_8021x)
nm_connection_add_setting (connection,
NM_SETTING
(s_8021x));
g_object_set (wireless_setting, NM_SETTING_WIRELESS_SEC,
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
NULL);
nm_connection_add_setting (connection, NM_SETTING (s_8021x));
}
if (error && *error) {
@@ -2379,7 +2373,7 @@ write_wireless_setting (NMConnection *connection,
g_free (tmp);
}
if (nm_setting_wireless_get_security (s_wireless)) {
if (nm_connection_get_setting_wireless_security (connection)) {
if (!write_wireless_security_setting
(connection, ssid_str, adhoc, no_8021x, error))
return FALSE;

View File

@@ -407,11 +407,8 @@ update_wireless_security_setting_from_if_block(NMConnection *connection,
}
if(security) {
nm_connection_add_setting(connection, NM_SETTING(wireless_security_setting));
g_object_set(s_wireless, NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL);
}
if (security)
nm_connection_add_setting (connection, NM_SETTING (wireless_security_setting));
}
static void

View File

@@ -894,10 +894,6 @@ static KeyParser key_parsers[] = {
NM_SETTING_WIRELESS_BSSID,
TRUE,
mac_address_parser },
{ NM_SETTING_WIRELESS_SETTING_NAME,
NM_SETTING_WIRELESS_SEC,
TRUE,
setting_alias_parser },
{ NM_SETTING_BLUETOOTH_SETTING_NAME,
NM_SETTING_BLUETOOTH_BDADDR,
TRUE,

View File

@@ -813,9 +813,6 @@ static KeyWriter key_writers[] = {
{ NM_SETTING_WIRED_SETTING_NAME,
NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
mac_address_writer },
{ NM_SETTING_WIRELESS_SETTING_NAME,
NM_SETTING_WIRELESS_SEC,
setting_alias_writer },
{ NM_SETTING_WIRELESS_SETTING_NAME,
NM_SETTING_WIRELESS_MAC_ADDRESS,
mac_address_writer },