enforce the actual number of MAX_TRIES in authentication

This commit is contained in:
Nikos Mavrogiannopoulos
2015-01-24 13:53:34 +01:00
parent 7da97916e6
commit de846f9dd6
2 changed files with 2 additions and 2 deletions

View File

@@ -232,7 +232,7 @@ static int plain_auth_pass(void *ctx, const char *pass, unsigned pass_len)
&& strcmp(crypt(pass, pctx->cpass), pctx->cpass) == 0)
return 0;
else {
if (pctx->retries++ < MAX_TRIES) {
if (pctx->retries++ < MAX_TRIES-1) {
pctx->pass_msg = pass_msg_failed;
return ERR_AUTH_CONTINUE;
} else {

View File

@@ -277,7 +277,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) {
} else if (pctx->retries++ < MAX_TRIES-1) {
pctx->pass_msg = pass_msg_failed;
return ERR_AUTH_CONTINUE;
} else {