} \
} while (0)
-/** Run an async or sync search LDAP query on a trunk connection
+/** Run an async search LDAP query on a trunk connection
*
- * @param[out] p_result from synchronous evaluation.
* @param[in] ctx to allocate the query in.
* @param[out] out that has been allocated.
* @param[in] request this query relates to.
* - UNLANG_ACTION_FAIL on error.
* - UNLANG_ACTION_PUSHED_CHILD on success.
*/
-unlang_action_t fr_ldap_trunk_search(rlm_rcode_t *p_result,
- TALLOC_CTX *ctx,
+unlang_action_t fr_ldap_trunk_search(TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *base_dn, int scope, char const *filter, char const * const *attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls)
default:
error:
- if (p_result) *p_result = RLM_MODULE_FAIL;
*out = NULL;
talloc_free(query);
return UNLANG_ACTION_FAIL;
/** Run an async modification LDAP query on a trunk connection
*
- * @param[out] p_result from synchronous evaluation.
* @param[in] ctx to allocate the query in.
* @param[out] out that has been allocated.
* @param[in] request this query relates to.
* - UNLANG_ACTION_FAIL on error.
* - UNLANG_ACTION_PUSHED_CHILD on success.
*/
-unlang_action_t fr_ldap_trunk_modify(rlm_rcode_t *p_result,
- TALLOC_CTX *ctx,
+unlang_action_t fr_ldap_trunk_modify(TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *dn, LDAPMod *mods[],
LDAPControl **serverctrls, LDAPControl **clientctrls)
default:
error:
*out = NULL;
- *p_result = RLM_MODULE_FAIL;
talloc_free(query);
return UNLANG_ACTION_FAIL;
}
/** Run an async LDAP "extended operation" query on a trunk connection
*
- * @param[out] p_result from synchronous evaluation.
* @param[in] ctx to allocate the query in.
* @param[out] out that has been allocated.
* @param[in] request this query relates to.
* - UNLANG_ACTION_FAIL on error.
* - UNLANG_ACTION_PUSHED_CHILD on success.
*/
-unlang_action_t fr_ldap_trunk_extended(rlm_rcode_t *p_result,
- TALLOC_CTX *ctx,
+unlang_action_t fr_ldap_trunk_extended(TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *reqoid, struct berval *reqdata,
LDAPControl **serverctrls, LDAPControl **clientctrls)
default:
error:
*out = NULL;
- *p_result = RLM_MODULE_FAIL;
talloc_free(query);
return UNLANG_ACTION_FAIL;
}
fr_ldap_query_t *fr_ldap_extended_alloc(TALLOC_CTX *ctx, char const *reqiod, struct berval *reqdata,
LDAPControl **serverctrls, LDAPControl **clientctrls);
-unlang_action_t fr_ldap_trunk_search(rlm_rcode_t *p_result,
- TALLOC_CTX *ctx,
+unlang_action_t fr_ldap_trunk_search(TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *base_dn, int scope, char const *filter, char const * const *attrs,
LDAPControl **serverctrls, LDAPControl **clientctrls);
-unlang_action_t fr_ldap_trunk_modify(rlm_rcode_t *p_result,
- TALLOC_CTX *ctx,
+unlang_action_t fr_ldap_trunk_modify(TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *dn, LDAPMod *mods[],
LDAPControl **serverctrls, LDAPControl **clientctrls);
-unlang_action_t fr_ldap_trunk_extended(rlm_rcode_t *p_result,
- TALLOC_CTX *ctx,
+unlang_action_t fr_ldap_trunk_extended(TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *reqoid, struct berval *reqdata,
LDAPControl **serverctrls, LDAPControl **clientctrls);
* @param uctx eDir lookup context.
* @return One of the RLM_MODULE_* values.
*/
-static unlang_action_t ldap_edir_get_password_start(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request,
+static unlang_action_t ldap_edir_get_password_start(UNUSED rlm_rcode_t *p_result, UNUSED int *priority, request_t *request,
void *uctx)
{
ldap_edir_ctx_t *edir_ctx = talloc_get_type_abort(uctx, ldap_edir_ctx_t);
- return fr_ldap_trunk_extended(p_result, edir_ctx, &edir_ctx->query, request, edir_ctx->ttrunk,
+ return fr_ldap_trunk_extended(edir_ctx, &edir_ctx->query, request, edir_ctx->ttrunk,
edir_ctx->reqoid, edir_ctx->dn, NULL, NULL);
}
inst->groupobj_filter ? ")" : "",
group_ctx->group_name[0] && group_ctx->group_name[1] ? ")" : "");
- return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, group_ctx->ttrunk,
+ return fr_ldap_trunk_search(group_ctx, &group_ctx->query, request, group_ctx->ttrunk,
group_ctx->base_dn->vb_strvalue, inst->groupobj_scope, filter,
null_attrs, NULL, NULL);
}
RDEBUG2("Resolving group DN \"%s\" to group name", *group_ctx->dn);
- return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, group_ctx->ttrunk, *group_ctx->dn,
+ return fr_ldap_trunk_search(group_ctx, &group_ctx->query, request, group_ctx->ttrunk, *group_ctx->dn,
LDAP_SCOPE_BASE, NULL, group_ctx->attrs, NULL, NULL);
}
* @param[in] uctx Group lookup context.
* @return One of the RLM_MODULE_* values.
*/
-static unlang_action_t ldap_cacheable_groupobj_start(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request,
+static unlang_action_t ldap_cacheable_groupobj_start(UNUSED rlm_rcode_t *p_result, UNUSED int *priority, request_t *request,
void *uctx)
{
ldap_group_groupobj_ctx_t *group_ctx = talloc_get_type_abort(uctx, ldap_group_groupobj_ctx_t);
rlm_ldap_t const *inst = group_ctx->inst;
group_ctx->attrs[0] = inst->groupobj_name_attr;
- return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, group_ctx->ttrunk,
+ return fr_ldap_trunk_search(group_ctx, &group_ctx->query, request, group_ctx->ttrunk,
group_ctx->base_dn->vb_strvalue, inst->groupobj_scope,
group_ctx->filter, group_ctx->attrs, NULL, NULL);
}
RDEBUG2("Resolving group DN \"%pV\" to group name", fr_box_strvalue_buffer(group_ctx->lookup_dn));
- return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, xlat_ctx->ttrunk,
+ return fr_ldap_trunk_search(group_ctx, &group_ctx->query, request, xlat_ctx->ttrunk,
group_ctx->lookup_dn, LDAP_SCOPE_BASE, NULL, group_ctx->attrs,
NULL, NULL);
}
* Used when the user's DN is already known but cached group membership has not been stored
*
*/
-static unlang_action_t ldap_check_userobj_start(rlm_rcode_t *p_result, UNUSED int *priority,
+static unlang_action_t ldap_check_userobj_start(UNUSED rlm_rcode_t *p_result, UNUSED int *priority,
request_t *request, void *uctx)
{
ldap_group_userobj_dyn_ctx_t *group_ctx = talloc_get_type_abort(uctx, ldap_group_userobj_dyn_ctx_t);
ldap_memberof_xlat_ctx_t *xlat_ctx = talloc_get_type_abort(group_ctx->xlat_ctx, ldap_memberof_xlat_ctx_t);
- return fr_ldap_trunk_search(p_result, xlat_ctx, &xlat_ctx->query, request, xlat_ctx->ttrunk, xlat_ctx->dn,
+ return fr_ldap_trunk_search(xlat_ctx, &xlat_ctx->query, request, xlat_ctx->ttrunk, xlat_ctx->dn,
LDAP_SCOPE_BASE, NULL, xlat_ctx->attrs, NULL, NULL);
}
return UNLANG_ACTION_FAIL;
}
- return fr_ldap_trunk_search(NULL, profile_ctx, &profile_ctx->query, request, ttrunk, dn,
+ return fr_ldap_trunk_search(profile_ctx, &profile_ctx->query, request, ttrunk, dn,
scope, filter,
expanded->attrs, NULL, NULL);
}
static unlang_action_t mod_map_proc(rlm_rcode_t *p_result, void *mod_inst, UNUSED void *proc_inst, request_t *request,
fr_value_box_list_t *url, map_list_t const *maps)
{
- rlm_rcode_t rcode = RLM_MODULE_UPDATED;
rlm_ldap_t *inst = talloc_get_type_abort(mod_inst, rlm_ldap_t);
fr_ldap_thread_t *thread = talloc_get_type_abort(module_rlm_thread_by_data(inst)->data, fr_ldap_thread_t);
if (unlang_function_push(request, NULL, mod_map_resume, NULL, 0,
UNLANG_SUB_FRAME, map_ctx) != UNLANG_ACTION_PUSHED_CHILD) goto fail;
- return fr_ldap_trunk_search(&rcode, map_ctx, &map_ctx->query, request, ttrunk, ldap_url->lud_dn,
+ return fr_ldap_trunk_search(map_ctx, &map_ctx->query, request, ttrunk, ldap_url->lud_dn,
ldap_url->lud_scope, ldap_url->lud_filter, map_ctx->expanded.attrs,
NULL, NULL);
}
if (unlang_function_push(request, NULL, user_modify_final, user_modify_cancel, ~FR_SIGNAL_CANCEL,
UNLANG_SUB_FRAME, usermod_ctx) < 0) goto fail;
- return fr_ldap_trunk_modify(p_result, usermod_ctx, &usermod_ctx->query, request, usermod_ctx->ttrunk,
+ return fr_ldap_trunk_modify(usermod_ctx, &usermod_ctx->query, request, usermod_ctx->ttrunk,
usermod_ctx->dn, modify, NULL, NULL);
}
return UNLANG_ACTION_FAIL;
}
- return fr_ldap_trunk_search(NULL, user_ctx, &user_ctx->query, request, user_ctx->ttrunk,
+ return fr_ldap_trunk_search(user_ctx, &user_ctx->query, request, user_ctx->ttrunk,
user_ctx->base_dn, user_ctx->inst->userobj_scope, user_ctx->filter,
user_ctx->attrs, serverctrls, NULL);
}