/**
*/
-unlang_action_t process_authenticate(rlm_rcode_t *p_result, int auth_type, request_t *request)
+unlang_action_t process_authenticate(rlm_rcode_t *p_result, int auth_type, request_t *request, CONF_SECTION *server_cs)
{
rlm_rcode_t rcode;
- CONF_SECTION *cs;
char const *module;
char const *component;
fr_dict_attr_t const *da;
CONF_SECTION *subcs;
fr_dict_t const *dict_internal;
- cs = cf_section_find(unlang_call_current(request), "authenticate", NULL);
- if (!cs) {
- RDEBUG2("Empty 'authenticate' section in virtual server \"%s\". Using default return value (%s)",
- cf_section_name2(unlang_call_current(request)),
- fr_table_str_by_value(rcode_table, RLM_MODULE_REJECT, "<invalid>"));
- RETURN_MODULE_REJECT;
- }
-
/*
* Figure out which section to run.
*/
dv = fr_dict_enum_by_value(da, fr_box_uint32((uint32_t) auth_type));
if (!dv) RETURN_MODULE_FAIL;
- subcs = cf_section_find(cs, da->name, dv->name);
+ subcs = cf_section_find(server_cs, "authenticate", dv->name);
if (!subcs) {
RDEBUG2("%s %s sub-section not found. Using default return values.",
da->name, dv->name);
RDEBUG("Running %s %s from file %s",
da->name, dv->name, cf_filename(subcs));
- cs = subcs;
/*
* Cache and restore these, as they're re-set when
request->component = "authenticate";
- if (unlang_interpret_push_section(request, cs, RLM_MODULE_REJECT, UNLANG_TOP_FRAME) < 0) {
+ if (unlang_interpret_push_section(request, subcs, RLM_MODULE_REJECT, UNLANG_TOP_FRAME) < 0) {
RETURN_MODULE_FAIL;
}
- rcode = unlang_interpret(request);
+ rcode = unlang_interpret_synchronous(request);
request->component = component;
request->module = module;
CONF_ITEM *ci);
/** @} */
-unlang_action_t process_authenticate(rlm_rcode_t *p_result, int auth_type, request_t *request);
+unlang_action_t process_authenticate(rlm_rcode_t *p_result, int auth_type, request_t *request, CONF_SECTION *server_cs);
rlm_rcode_t virtual_server_process_auth(request_t *request, CONF_SECTION *virtual_server,
rlm_rcode_t default_rcode,
/*
* Call the authenticate section of the *current* virtual server.
*/
- process_authenticate(&rcode, inst->auth_type->value->vb_uint32, request);
+ process_authenticate(&rcode, inst->auth_type->value->vb_uint32,
+ request, unlang_call_current(request->parent));
if (rcode != RLM_MODULE_OK) {
eap_round->request->code = FR_EAP_CODE_FAILURE;
RETURN_MODULE_RCODE(rcode);
*/
unlang = cf_section_find(unlang_call_current(request), "authenticate", inst->auth_type->name);
if (!unlang) {
- process_authenticate(&rcode, inst->auth_type->value->vb_uint32, request);
+ process_authenticate(&rcode, inst->auth_type->value->vb_uint32,
+ request, unlang_call_current(request->parent));
} else {
if (unlang_interpret_push_section(request, unlang, RLM_MODULE_FAIL, UNLANG_TOP_FRAME) < 0) {
RETURN_MODULE_FAIL;
}
- rcode = unlang_interpret(request);
-
- /*
- * If it's yielding, set up the process function
- * to continue after resume.
- */
- if (rcode == RLM_MODULE_YIELD) {
- eap_session->process = mod_process_auth_type;
- return UNLANG_ACTION_YIELD;
- }
+ rcode = unlang_interpret_synchronous(request);
}
return mschap_finalize(p_result, mctx, request, eap_session, rcode);