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_2_2_0~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2197ff9bc5bd58ac4359d9843c9ca812e33a1140;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 b6f7baa9af5..465f70e1cdf 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -539,9 +539,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; } @@ -551,13 +564,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; } }