X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Frealms.c;h=8125662d3029bbb0dfcdf356df4a12d7fd370fb6;hb=d1dfb808af3e0d39ed5b5ee42d53bd31acba2d84;hp=c820045945afe7e03bfe6f50aae05d36d108d233;hpb=93fdfcf9a430598360435ed866315719c3823684;p=freeradius.git diff --git a/src/main/realms.c b/src/main/realms.c index c820045..8125662 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; } }