Skip to content

Commit 76ed4dd

Browse files
committed
Pass in the module instance to the rlm_mschap connection function
1 parent e2fe0b8 commit 76ed4dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/modules/rlm_mschap/rlm_mschap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,8 @@ static int _mod_conn_free(struct wbcContext **wb_ctx)
797797
*/
798798
static void *mod_conn_create(TALLOC_CTX *ctx, UNUSED void *instance, UNUSED fr_time_delta_t timeout)
799799
{
800+
module_instance_t *mi = talloc_get_type_abort(instance, module_instance_t); /* Needed by ERROR() */
801+
rlm_mschap_t const *inst = talloc_get_type_abort_const(mi->data, rlm_mschap_t);
800802
struct wbcContext **wb_ctx;
801803

802804
wb_ctx = talloc_zero(ctx, struct wbcContext *);
@@ -2404,7 +2406,7 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
24042406
#ifdef WITH_AUTH_WINBIND
24052407
inst->method = AUTH_WBCLIENT;
24062408

2407-
inst->wb_pool = module_rlm_connection_pool_init(conf, inst, mod_conn_create, NULL, NULL, NULL, NULL);
2409+
inst->wb_pool = module_rlm_connection_pool_init(conf, mctx->mi, mod_conn_create, NULL, NULL, NULL, NULL);
24082410
if (!inst->wb_pool) {
24092411
cf_log_err(conf, "Unable to initialise winbind connection pool");
24102412
return -1;

0 commit comments

Comments
 (0)