Skip to content

Commit

Permalink
remove Simultaneous-Use from the new listeners
Browse files Browse the repository at this point in the history
They're still in the old listeners for now.

The functionality can be replicated in v4 via maps, exec'd
programs, and child virtual servers
  • Loading branch information
alandekok committed May 16, 2017
1 parent 33d9540 commit b6d07f9
Showing 1 changed file with 0 additions and 71 deletions.
71 changes: 0 additions & 71 deletions src/modules/proto_radius/proto_radius_auth.c
Expand Up @@ -31,8 +31,6 @@
#include <freeradius-devel/io/transport.h>
#include <freeradius-devel/rad_assert.h>

#define REQUEST_SIMULTANEOUS_USE (REQUEST_OTHER_1)

#ifndef USEC
#define USEC (1000000)
#endif
Expand Down Expand Up @@ -515,59 +513,6 @@ static fr_transport_final_t auth_process(REQUEST *request)
goto setup_send;
}

/*
* When the user has been successfully
* authenticated, ook for Simultaneous-Use. But
* only if we have a User-Name.
*/
vp = fr_pair_find_by_num(request->control, 0, PW_SIMULTANEOUS_USE, TAG_ANY);
if (vp && request->username) {
unlang = cf_subsection_find_name2(request->server_cs, "process", "Simultaneous-Use");
if (!unlang) {
REDEBUG2("No 'process Simultaneous' section found.");
goto post_simul;
}

RDEBUG("Running 'process %s' from file %s", cf_section_name2(unlang), cf_section_filename(unlang));
unlang_push_section(request, unlang, RLM_MODULE_NOTFOUND);

request->request_state = REQUEST_SIMULTANEOUS_USE;
/* FALL-THROUGH */

case REQUEST_SIMULTANEOUS_USE:
rcode = unlang_interpret_continue(request);

if (request->master_state == REQUEST_STOP_PROCESSING) return FR_TRANSPORT_DONE;

if (rcode == RLM_MODULE_YIELD) return FR_TRANSPORT_YIELD;

request->log.unlang_indent = 0;

switch (rcode) {
default:
RDEBUG2("Simultaneous-Use checks failed.");
request->reply->code = PW_CODE_ACCESS_REJECT;

if ((vp = fr_pair_find_by_num(request->packet->vps, 0, PW_MODULE_FAILURE_MESSAGE, TAG_ANY)) != NULL){
char msg[FR_MAX_STRING_LEN+19];

snprintf(msg, sizeof(msg), "Login limit exceeded (%s)",
vp->vp_strvalue);
auth_message(msg, request, 0);
} else {
auth_message("Login limit exceeded", request, 0);
}
goto setup_send;

case RLM_MODULE_NOOP:
case RLM_MODULE_OK:
case RLM_MODULE_UPDATED:
case RLM_MODULE_HANDLED:
break;
}
} /* else there's no Simultaneous-Use checking */

post_simul:
/*
* Allow for over-ride of reply code.
*/
Expand Down Expand Up @@ -1073,17 +1018,6 @@ static int auth_listen_compile(CONF_SECTION *server_cs, UNUSED CONF_SECTION *lis

cf_log_module(subcs, "Loading process %s {...}", name2);

/*
* Simultaneous-Use is special.
*/
if (strcmp(name2, "Simultaneous-Use") == 0) {
if (unlang_compile(subcs, MOD_SESSION) < 0) {
cf_log_err_cs(subcs, "Failed compiling 'process %s { ... }' section", name2);
return -1;
}
continue;
}

if (unlang_compile(subcs, MOD_AUTHENTICATE) < 0) {
cf_log_err_cs(subcs, "Failed compiling 'process %s { ... }' section", name2);
return -1;
Expand Down Expand Up @@ -1117,11 +1051,6 @@ static int auth_listen_bootstrap(CONF_SECTION *server_cs, UNUSED CONF_SECTION *l
return -1;
}

/*
* No Auth-Type for this.
*/
if (strcmp(name2, "Simultaneous-Use") == 0) continue;

/*
* If the value already exists, don't
* create it again.
Expand Down

0 comments on commit b6d07f9

Please sign in to comment.