summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-17 11:46:48 +0100
committerThomas Haller <thaller@redhat.com>2015-03-17 12:05:59 +0100
commitf7fc65ab79202f102badfb7afe827ff46d433b96 (patch)
treef1656001d3fe4da7e92f982ce28eb81b9bbfe283
parent5425261513451714a52d0e8b47ed95cf793c8c0d (diff)
downloadNetworkManager-f7fc65ab79202f102badfb7afe827ff46d433b96.tar.gz
fixup! libnm: don't check for valid passwords in NMSettingWirelessSecurity:verify()
-rw-r--r--libnm-core/nm-setting-adsl.c11
-rw-r--r--libnm-core/nm-setting-cdma.c11
-rw-r--r--libnm-core/nm-setting-gsm.c11
-rw-r--r--libnm-core/nm-setting-wireless-security.c2
-rw-r--r--libnm-util/nm-setting-adsl.c11
-rw-r--r--libnm-util/nm-setting-cdma.c11
-rw-r--r--libnm-util/nm-setting-gsm.c11
-rw-r--r--libnm-util/nm-setting-wireless-security.c2
8 files changed, 8 insertions, 62 deletions
diff --git a/libnm-core/nm-setting-adsl.c b/libnm-core/nm-setting-adsl.c
index 00bcef5431..2e71f8e790 100644
--- a/libnm-core/nm-setting-adsl.c
+++ b/libnm-core/nm-setting-adsl.c
@@ -199,15 +199,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_PASSWORD);
- return FALSE;
- }
-
if ( !priv->protocol
|| ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
@@ -242,7 +233,7 @@ need_secrets (NMSetting *setting)
NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (!(priv->password_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED)) {
diff --git a/libnm-core/nm-setting-cdma.c b/libnm-core/nm-setting-cdma.c
index ebbbda740d..ecc387c8f5 100644
--- a/libnm-core/nm-setting-cdma.c
+++ b/libnm-core/nm-setting-cdma.c
@@ -160,15 +160,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_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;
}
@@ -178,7 +169,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) {
diff --git a/libnm-core/nm-setting-gsm.c b/libnm-core/nm-setting-gsm.c
index fb76d18f05..36557a256c 100644
--- a/libnm-core/nm-setting-gsm.c
+++ b/libnm-core/nm-setting-gsm.c
@@ -285,15 +285,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_PASSWORD);
- return FALSE;
- }
-
if (priv->network_id) {
guint32 nid_len = strlen (priv->network_id);
guint32 i;
@@ -331,7 +322,7 @@ need_secrets (NMSetting *setting)
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (priv->username) {
diff --git a/libnm-core/nm-setting-wireless-security.c b/libnm-core/nm-setting-wireless-security.c
index 23f317e8d5..a56a8e9757 100644
--- a/libnm-core/nm-setting-wireless-security.c
+++ b/libnm-core/nm-setting-wireless-security.c
@@ -822,7 +822,7 @@ need_secrets (NMSetting *setting)
if ( priv->auth_alg
&& !strcmp (priv->auth_alg, "leap")
&& !strcmp (priv->key_mgmt, "ieee8021x")) {
- if (!priv->leap_password || !strlen (priv->leap_password)) {
+ if (!priv->leap_password || !*priv->leap_password) {
g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
return secrets;
}
diff --git a/libnm-util/nm-setting-adsl.c b/libnm-util/nm-setting-adsl.c
index 601ebc2b2a..5355011cd1 100644
--- a/libnm-util/nm-setting-adsl.c
+++ b/libnm-util/nm-setting-adsl.c
@@ -219,15 +219,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_SETTING_ADSL_ERROR,
- NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_PASSWORD);
- return FALSE;
- }
-
if ( !priv->protocol
|| ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
@@ -262,7 +253,7 @@ need_secrets (NMSetting *setting)
NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (!(priv->password_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED)) {
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) {
diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c
index 95c7a103df..e422c92e61 100644
--- a/libnm-util/nm-setting-gsm.c
+++ b/libnm-util/nm-setting-gsm.c
@@ -342,15 +342,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (priv->password && !strlen (priv->password)) {
- g_set_error_literal (error,
- NM_SETTING_GSM_ERROR,
- NM_SETTING_GSM_ERROR_INVALID_PROPERTY,
- _("property is empty"));
- g_prefix_error (error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_PASSWORD);
- return FALSE;
- }
-
if (priv->network_id) {
guint32 nid_len = strlen (priv->network_id);
guint32 i;
@@ -388,7 +379,7 @@ need_secrets (NMSetting *setting)
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (setting);
GPtrArray *secrets = NULL;
- if (priv->password)
+ if (priv->password && *priv->password)
return NULL;
if (priv->username) {
diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c
index b4e97c04a2..574ff3bd52 100644
--- a/libnm-util/nm-setting-wireless-security.c
+++ b/libnm-util/nm-setting-wireless-security.c
@@ -852,7 +852,7 @@ need_secrets (NMSetting *setting)
if ( priv->auth_alg
&& !strcmp (priv->auth_alg, "leap")
&& !strcmp (priv->key_mgmt, "ieee8021x")) {
- if (!priv->leap_password || !strlen (priv->leap_password)) {
+ if (!priv->leap_password || !*priv->leap_password) {
g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
return secrets;
}