diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-09 12:52:28 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-20 13:01:04 +0100 |
commit | dbbedce21f0dbb2849ed48bd2cee3b98e1ad2135 (patch) | |
tree | e9de897b23447724b7771e03d6a570f30ba6a2e4 /libnm-util/nm-setting-cdma.c | |
parent | 8e58fc742580836df67da84a4bfbf53453e989e5 (diff) | |
download | NetworkManager-dbbedce21f0dbb2849ed48bd2cee3b98e1ad2135.tar.gz |
libnm: don't check for valid passwords in NMSetting:verify()
We must never fail verification of a connection based on a password
because the password is re-requested during activation.
Otherwise, if the user enters an invalid password for a (previously)
valid connection, the connection becomes invalid. NetworkManager does
not expect or handle that requesting password can make a connection
invalid.
Invalid passwords should be treated as wrong passwords. Only a UI
(such as nm-connection-editor or nmcli) should validate passwords
against a certain scheme.
Note that there is need_secrets() which on the contrary must check for
valid passwords.
Error scenario:
Connect to a WEP Wi-Fi, via `nmcli device wifi connect SSID`. The
generated connection has wep-key-type=0 (UNKNOWN) and wep-key-flags=0.
When trying to connect, NM will ask for secrets and set the wep-key0
field. After that, verification can fail (e.g. if the password is longer
then 64 chars).
Diffstat (limited to 'libnm-util/nm-setting-cdma.c')
-rw-r--r-- | libnm-util/nm-setting-cdma.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c index 44a893c7bb..53f886ece3 100644 --- a/libnm-util/nm-setting-cdma.c +++ b/libnm-util/nm-setting-cdma.c @@ -181,15 +181,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) return FALSE; } - if (priv->password && !strlen (priv->password)) { - g_set_error_literal (error, - NM_SETTING_CDMA_ERROR, - NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, - _("property is empty")); - g_prefix_error (error, "%s.%s: ", NM_SETTING_CDMA_SETTING_NAME, NM_SETTING_CDMA_PASSWORD); - return FALSE; - } - return TRUE; } @@ -199,7 +190,7 @@ need_secrets (NMSetting *setting) NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (setting); GPtrArray *secrets = NULL; - if (priv->password) + if (priv->password && *priv->password) return NULL; if (priv->username) { |