Skip to content

Commit

Permalink
Add rlm module specific data lookup function
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed May 10, 2024
1 parent 341d246 commit c1f8769
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/server/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ unlang_action_t rad_virtual_server(rlm_rcode_t *p_result, request_t *request)

RDEBUG("server %s {", cf_section_name2(unlang_call_current(request)));
request->async->process(&final,
MODULE_CTX(module_instance_by_data(request->async->process_inst), NULL, NULL, NULL),
MODULE_CTX(module_rlm_by_data(request->async->process_inst), NULL, NULL, NULL),
request);
RDEBUG("} # server %s", cf_section_name2(unlang_call_current(request)));

Expand Down
5 changes: 5 additions & 0 deletions src/lib/server/module_rlm.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,11 @@ module_instance_t *module_rlm_by_name(module_instance_t const *parent, char cons
return module_instance_by_name(rlm_modules, parent, asked_name);
}

module_instance_t *module_rlm_by_data(module_instance_t const *data)
{
return module_instance_by_data(rlm_modules, data);
}

/** Create a virtual module.
*
* @param[in] cs that defines the virtual module.
Expand Down
2 changes: 2 additions & 0 deletions src/lib/server/module_rlm.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ module_thread_instance_t *module_rlm_thread_by_data(void const *data);

module_instance_t *module_rlm_by_name(module_instance_t const *parent, char const *asked_name);

module_instance_t *module_rlm_by_data(module_instance_t const *data);

CONF_SECTION *module_rlm_by_name_virtual(char const *asked_name);

/** @} */
Expand Down
2 changes: 1 addition & 1 deletion src/modules/rlm_mschap/rlm_mschap.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ static int _mod_conn_free(struct wbcContext **wb_ctx)
static void *mod_conn_create(TALLOC_CTX *ctx, void *instance, UNUSED fr_time_delta_t timeout)
{
struct wbcContext **wb_ctx;
module_inst_ctx_t *mctx = MODULE_INST_CTX(module_instance_by_data(instance));
module_inst_ctx_t *mctx = MODULE_INST_CTX(module_rlm_by_data(instance));

wb_ctx = talloc_zero(ctx, struct wbcContext *);
*wb_ctx = wbcCtxCreate();
Expand Down

0 comments on commit c1f8769

Please sign in to comment.