commit d9f0cc47d0449d94bb6996d6c086bfc73fb387cf
parent 451a7e9b527c7dd9b47d03e3baf2b778ace6046c
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Fri, 8 Feb 2019 18:32:12 +0100
eap: Remove redundant error messages in .load_settings
A method's .check_settings method checks for inconsistent setting files
and prints readable errors so there's no need to do that again in
.load_settings, although at some point after removing the duplicate
error messages from the load_settings methods we agreed to keep minimum
checks that could cause a crash e.g. in a corner case like when the
setting file got modified between the check_settings and the
load_settings call. Some error messages have been re-added to
load_settings after that (e.g. in
bb4e1ebd4f8f533fe854231bc06d842d8d55843e) but they're incomplete and not
useful so remove them.
Diffstat:
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/src/eap-gtc.c b/src/eap-gtc.c
@@ -144,11 +144,8 @@ static bool eap_gtc_load_settings(struct eap_state *eap,
prefix);
password = l_settings_get_string(settings, "Security",
password_key);
-
- if (!password) {
- l_error("Property '%sPassword' is missing.", prefix);
+ if (!password)
return false;
- }
}
gtc = l_new(struct eap_gtc_state, 1);
diff --git a/src/eap-md5.c b/src/eap-md5.c
@@ -160,11 +160,8 @@ static bool eap_md5_load_settings(struct eap_state *eap,
prefix);
secret = l_settings_get_string(settings, "Security",
password_key);
-
- if (!secret) {
- l_error("Property '%sPassword' is missing.", prefix);
+ if (!secret)
return false;
- }
}
md5 = l_new(struct eap_md5_state, 1);
diff --git a/src/eap-mschapv2.c b/src/eap-mschapv2.c
@@ -545,10 +545,8 @@ static bool eap_mschapv2_load_settings(struct eap_state *eap,
snprintf(setting, sizeof(setting), "%sIdentity", prefix);
state->user = l_settings_get_string(settings, "Security", setting);
- if (!state->user) {
- l_error("'%s' setting is missing", setting);
+ if (!state->user)
goto error;
- }
state->user_len = strlen(state->user);
@@ -565,11 +563,8 @@ static bool eap_mschapv2_load_settings(struct eap_state *eap,
snprintf(setting, sizeof(setting), "%sPassword-Hash", prefix);
hash_str = l_settings_get_value(settings, "Security", setting);
- if (!hash_str) {
- l_error("Neither '%sPassword' or '%sPassword-Hash' "
- "setting was provided", prefix, prefix);
+ if (!hash_str)
goto error;
- }
tmp = l_util_from_hexstring(hash_str, &len);
memcpy(state->password_hash, tmp, 16);