diff --git a/src/main-auth.c b/src/main-auth.c index 85e45f78..0cf4f1d9 100644 --- a/src/main-auth.c +++ b/src/main-auth.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Nikos Mavrogiannopoulos + * Copyright (C) 2013, 2014 Nikos Mavrogiannopoulos * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main-misc.c b/src/main-misc.c index 580f5941..9c4141e8 100644 --- a/src/main-misc.c +++ b/src/main-misc.c @@ -404,20 +404,19 @@ static int handle_auth_res(main_server_st * s, struct proc_st *proc, } else if (result == 0) { ret = accept_user(s, proc, cmd); if (ret < 0) { - goto auth_ok; + goto finished; } proc->status = PS_AUTH_COMPLETED; - goto auth_ok; } else if (result < 0) { add_to_ip_ban_list(s, &proc->remote_addr, proc->remote_addr_len); - return result; + ret = result; } else { mslog(s, proc, LOG_ERR, "unexpected auth result: %d\n", result); - return ERR_BAD_COMMAND; + ret = ERR_BAD_COMMAND; } - auth_ok: + finished: if (ret == ERR_WAIT_FOR_SCRIPT) ret = 0; else { @@ -687,6 +686,8 @@ int handle_commands(main_server_st * s, struct proc_st *proc) goto cleanup; } + break; + case AUTH_REQ: if (proc->status != PS_AUTH_INIT) { mslog(s, proc, LOG_ERR,