diff options
| author | Jiří Klimeš <jklimes@redhat.com> | 2013-08-27 16:11:30 +0200 |
|---|---|---|
| committer | Jiří Klimeš <jklimes@redhat.com> | 2013-09-02 09:46:31 +0200 |
| commit | 0185e8371fe8581c512311118113140ffcbcdbb2 (patch) | |
| tree | dd1bb68b04859abe778acea51c5bbf75ff888f30 /libnm-util | |
| parent | 284cce0405e571d3f25546c11e6ec425aa294e5e (diff) | |
| download | NetworkManager-0185e8371fe8581c512311118113140ffcbcdbb2.tar.gz | |
libnm-util: deprecate 'security' property of '802-11-wireless' setting
'security' property is redundant, because the security restrictions are easily
recognized by the presence of '802-11-wireless-security' in a Wi-Fi connection.
The setting has to be present anyway, but we also had to set and check whether
the value in 'security' matches the security setting.
Following the KISS principle, it is best not to use the 'security' property
altogether.
Diffstat (limited to 'libnm-util')
| -rw-r--r-- | libnm-util/nm-setting-wireless.c | 28 | ||||
| -rw-r--r-- | libnm-util/nm-setting-wireless.h | 8 |
2 files changed, 13 insertions, 23 deletions
diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c index 655d717e6f..c2d44ed727 100644 --- a/libnm-util/nm-setting-wireless.c +++ b/libnm-util/nm-setting-wireless.c @@ -588,6 +588,9 @@ nm_setting_wireless_get_mtu (NMSettingWireless *setting) * @setting: the #NMSettingWireless * * Returns: the #NMSettingWireless:security property of the setting + * + * Deprecated: 0.9.10: No longer used. Security rescrictions are recognized by + * the presence of NM_SETTING_WIRELESS_SECURITY_SETTING_NAME in the connection. **/ const char * nm_setting_wireless_get_security (NMSettingWireless *setting) @@ -687,15 +690,6 @@ nm_setting_wireless_get_seen_bssid (NMSettingWireless *setting, return (const char *) g_slist_nth_data (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids, i); } -static gint -find_setting_by_name (gconstpointer a, gconstpointer b) -{ - NMSetting *setting = NM_SETTING (a); - const char *str = (const char *) b; - - return strcmp (nm_setting_get_name (setting), str); -} - static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { @@ -819,17 +813,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) } } - if ( priv->security - && !g_slist_find_custom (all_settings, priv->security, find_setting_by_name)) { - g_set_error (error, - NM_SETTING_WIRELESS_ERROR, - NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING, - _("'%s' setting is required for the connection when the property is set"), - priv->security); - g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SEC); - return FALSE; - } - return TRUE; } @@ -974,7 +957,7 @@ get_property (GObject *object, guint prop_id, g_value_set_boxed (value, NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids); break; case PROP_SEC: - g_value_set_string (value, nm_setting_wireless_get_security (setting)); + g_value_set_string (value, NM_SETTING_WIRELESS_GET_PRIVATE (setting)->security); break; case PROP_HIDDEN: g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting)); @@ -1231,6 +1214,9 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class) * If the wireless connection has any security restrictions, like 802.1x, * WEP, or WPA, set this property to '802-11-wireless-security' and ensure * the connection contains a valid 802-11-wireless-security setting. + * + * Deprecated: 0.9.10: No longer used. Security rescrictions are recognized by + * the presence of NM_SETTING_WIRELESS_SECURITY_SETTING_NAME in the connection. **/ g_object_class_install_property (object_class, PROP_SEC, diff --git a/libnm-util/nm-setting-wireless.h b/libnm-util/nm-setting-wireless.h index 1b50804c93..dbc1959e2f 100644 --- a/libnm-util/nm-setting-wireless.h +++ b/libnm-util/nm-setting-wireless.h @@ -75,9 +75,11 @@ GQuark nm_setting_wireless_error_quark (void); #define NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST "mac-address-blacklist" #define NM_SETTING_WIRELESS_MTU "mtu" #define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids" -#define NM_SETTING_WIRELESS_SEC "security" #define NM_SETTING_WIRELESS_HIDDEN "hidden" +/* Deprecated */ +#define NM_SETTING_WIRELESS_SEC "security" + /** * NM_SETTING_WIRELESS_MODE_ADHOC: * @@ -141,7 +143,6 @@ void nm_setting_wireless_remove_mac_blacklist_item (NMSettingWire guint32 idx); guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting); -const char *nm_setting_wireless_get_security (NMSettingWireless *setting); gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting); gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting, @@ -158,6 +159,9 @@ gboolean nm_setting_wireless_ap_security_compatible (NMSettingWireless NM80211ApSecurityFlags ap_rsn, NM80211Mode ap_mode); +/* Deprecated */ +G_DEPRECATED const char *nm_setting_wireless_get_security (NMSettingWireless *setting); + G_END_DECLS #endif /* NM_SETTING_WIRELESS_H */ |
