Ban an IP only when the MAX_PASSWORD_TRIES attempts have been exceeded

This commit is contained in:
Nikos Mavrogiannopoulos
2015-02-19 11:47:20 +01:00
committed by Nikos Mavrogiannopoulos
parent 1fc59e0099
commit 108d34f613
9 changed files with 114 additions and 40 deletions
+2 -1
View File
@@ -281,7 +281,7 @@ static int radius_auth_pass(void *ctx, const char *pass, unsigned pass_len)
if (ret == PW_ACCESS_CHALLENGE) {
pctx->pass_msg = pass_msg_second;
return ERR_AUTH_CONTINUE;
} else if (pctx->retries++ < MAX_TRIES-1) {
} else if (pctx->retries++ < MAX_PASSWORD_TRIES-1) {
pctx->pass_msg = pass_msg_failed;
return ERR_AUTH_CONTINUE;
} else {
@@ -508,6 +508,7 @@ VALUE_PAIR *send = NULL, *recvd = NULL;
const struct auth_mod_st radius_auth_funcs = {
.type = AUTH_TYPE_RADIUS | AUTH_TYPE_USERNAME_PASS,
.allows_retries = 1,
.global_init = radius_global_init,
.global_deinit = radius_global_deinit,
.auth_init = radius_auth_init,