From: Alan T. DeKok Date: Fri, 6 Jan 2012 13:54:56 +0000 (+0100) Subject: "username" and "password" cannot be non-empty for status_check=request X-Git-Tag: release_3_0_0_beta0~423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1dfb808af3e0d39ed5b5ee42d53bd31acba2d84;p=thirdparty%2Ffreeradius-server.git "username" and "password" cannot be non-empty for status_check=request Because some people misconfigure the server. --- diff --git a/src/main/realms.c b/src/main/realms.c index c820045945a..8125662d302 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -597,9 +597,22 @@ static int home_server_add(realm_config_t *rc, CONF_SECTION *cs) } else if (strcasecmp(hs_check, "request") == 0) { home->ping_check = HOME_PING_CHECK_REQUEST; + if (!home->ping_user_name || + !*home->ping_user_name) { + cf_log_err(cf_sectiontoitem(cs), "You must supply a 'username' to enable status_check=request"); + goto error; + } + + if ((home->type == HOME_TYPE_AUTH) && + (!home->ping_user_password || + !*home->ping_user_password)) { + cf_log_err(cf_sectiontoitem(cs), "You must supply a password to enable status_check=request"); + goto error; + } + } else { cf_log_err(cf_sectiontoitem(cs), - "Invalid ping_check \"%s\" for home server %s.", + "Invalid status__check \"%s\" for home server %s.", hs_check, name2); goto error; } @@ -609,13 +622,13 @@ static int home_server_add(realm_config_t *rc, CONF_SECTION *cs) if ((home->ping_check != HOME_PING_CHECK_NONE) && (home->ping_check != HOME_PING_CHECK_STATUS_SERVER)) { if (!home->ping_user_name) { - cf_log_err(cf_sectiontoitem(cs), "You must supply a user name to enable ping checks"); + cf_log_err(cf_sectiontoitem(cs), "You must supply a user name to enable status_check=request"); goto error; } if ((home->type == HOME_TYPE_AUTH) && !home->ping_user_password) { - cf_log_err(cf_sectiontoitem(cs), "You must supply a password to enable ping checks"); + cf_log_err(cf_sectiontoitem(cs), "You must supply a password to enable status_check=request"); goto error; } }