mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-13 18:12:03 +08:00
send auth reply failure when needed.
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+6
-5
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user