30 RCSID(
"$Id: eaf3a74c5207144d24b4c6762ad0889d13626668 $")
35 #include <freeradius-devel/ldap/conf.h>
37 #include <freeradius-devel/server/map_proc.h>
38 #include <freeradius-devel/server/module_rlm.h>
60 LDAPMessage *entry = NULL;
67 if (profile_ctx->
ret) *profile_ctx->
ret = query->
ret;
75 RDEBUG2(
"Profile object \"%s\" not found", profile_ctx->
dn);
85 entry = ldap_first_entry(handle, query->
result);
87 ldap_get_option(handle, LDAP_OPT_RESULT_CODE, &ldap_errno);
88 REDEBUG(
"Failed retrieving entry: %s", ldap_err2string(ldap_errno));
93 RDEBUG2(
"Processing profile attributes");
97 dn = ldap_get_dn(handle, entry);
98 RDEBUG2(
"Processing \"%s\"", dn);
103 profile_ctx->
expanded, entry) < 0) {
106 entry = ldap_next_entry(handle, entry);
146 char const *dn,
int scope,
char const *filter,
fr_ldap_map_exp_t const *expanded)
156 .expanded = expanded,
169 expanded->
attrs, NULL, NULL);
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
@ UNLANG_ACTION_FAIL
Encountered an unexpected error.
@ UNLANG_ACTION_CALCULATE_RESULT
Calculate a new section rlm_rcode_t value.
#define USES_APPLE_DEPRECATED_API
fr_dcursor_eval_t void const * uctx
#define unlang_function_push(_request, _func, _repeat, _signal, _sigmask, _top_frame, _uctx)
Push a generic function onto the unlang stack.
TALLOC_CTX * unlang_interpret_frame_talloc_ctx(request_t *request)
Get a talloc_ctx which is valid only for this frame.
LDAP * handle
libldap handle.
fr_ldap_result_code_t ret
Result code.
trunk_request_t * treq
Trunk request this query is associated with.
fr_ldap_connection_t * ldap_conn
LDAP connection this query is running on.
fr_ldap_result_code_t
LDAP query result codes.
@ LDAP_RESULT_ERROR
A general error occurred.
@ LDAP_RESULT_SUCCESS
Successfully got LDAP results.
@ LDAP_RESULT_NO_RESULT
No results returned.
@ LDAP_RESULT_BAD_DN
The requested DN does not exist.
LDAPMessage * result
Head of LDAP results list.
int fr_ldap_map_do(request_t *request, char const *valuepair_attr, fr_ldap_map_exp_t const *expanded, LDAPMessage *entry)
Convert attribute map into valuepairs.
char const * attrs[LDAP_MAX_ATTRMAP+LDAP_MAP_RESERVED+1]
Reserve some space for access attributes.
Result of expanding the RHS of a set of maps.
Thread LDAP trunk structure.
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)
Run an async search LDAP query on a trunk connection.
#define REXDENT()
Exdent (unindent) R* messages by one level.
#define RINDENT()
Indent R* messages by one level.
static unlang_action_t ldap_map_profile_resume(UNUSED rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx)
Process the results of a profile lookup.
unlang_action_t rlm_ldap_map_profile(fr_ldap_result_code_t *ret, rlm_ldap_t const *inst, request_t *request, fr_ldap_thread_trunk_t *ttrunk, char const *dn, int scope, char const *filter, fr_ldap_map_exp_t const *expanded)
Search for and apply an LDAP profile.
static void ldap_map_profile_cancel(UNUSED request_t *request, UNUSED fr_signal_t action, void *uctx)
Cancel an in progress profile lookup.
fr_ldap_result_code_t * ret
Result of the query and applying the map.
fr_ldap_map_exp_t const * expanded
Holds state of in progress async profile lookups.
#define RDEBUG_ENABLED2()
rlm_rcode_t
Return codes indicating the result of the module call.
char const * valuepair_attr
Generic dynamic mapping attribute, contains a RADIUS attribute and value.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
eap_aka_sim_process_conf_t * inst
void trunk_request_signal_cancel(trunk_request_t *treq)
Cancel a trunk request.