The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
Loading...
Searching...
No Matches
Data Structures | Functions
profile.c File Reference
#include "rlm_ldap.h"
#include <freeradius-devel/ldap/conf.h>
#include <freeradius-devel/server/map_proc.h>
#include <freeradius-devel/server/module_rlm.h>
+ Include dependency graph for profile.c:

Go to the source code of this file.

Data Structures

struct  ldap_profile_ctx_t
 Holds state of in progress async profile lookups. More...
 

Functions

static unlang_action_t ldap_map_profile_resume (request_t *request, void *uctx)
 Process the results of a profile lookup.
 
static void ldap_profile_entry_map (bool *fallthrough, request_t *request, ldap_profile_ctx_t *profile_ctx, LDAP *handle, LDAPMessage *entry)
 Apply the attribute map to a single profile entry.
 
static unlang_action_t ldap_profile_search_push (ldap_profile_ctx_t *profile_ctx, request_t *request, char const *base, int scope, char const *filter)
 Push the resume frame and start the first profile search.
 
unlang_action_t rlm_ldap_map_profile (fr_ldap_result_code_t *ret, int *applied, 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.
 
unlang_action_t rlm_ldap_map_profiles (fr_ldap_result_code_t *ret, int *applied, rlm_ldap_t const *inst, request_t *request, fr_ldap_thread_trunk_t *ttrunk, char const *const *dn_list, char const *filter, fr_ldap_map_exp_t const *expanded)
 Search for and apply a set of LDAP profiles.
 

Data Structure Documentation

◆ ldap_profile_ctx_t

struct ldap_profile_ctx_t

Holds state of in progress async profile lookups.

Definition at line 43 of file profile.c.

+ Collaboration diagram for ldap_profile_ctx_t:
Data Fields
int * applied Number of profiles applied.
char const * dn DN of the profile object being retrieved.

NULL when all profiles are retrieved by one search.

fr_ldap_map_exp_t const * expanded
char const * filter Filter to apply to profile searches.
rlm_ldap_t const * inst
char const *const * next Next profile DN to search for (search_mode = seq).
fr_ldap_query_t * query
fr_ldap_result_code_t * ret Result of the query and applying the map.
fr_ldap_thread_trunk_t * ttrunk Trunk used for profile searches.

Function Documentation

◆ ldap_map_profile_resume()

static unlang_action_t ldap_map_profile_resume ( request_t request,
void *  uctx 
)
static

Process the results of a profile lookup.

Definition at line 138 of file profile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ldap_profile_entry_map()

static void ldap_profile_entry_map ( bool fallthrough,
request_t request,
ldap_profile_ctx_t profile_ctx,
LDAP *  handle,
LDAPMessage *  entry 
)
static

Apply the attribute map to a single profile entry.

Parameters
[out]fallthroughWhether processing should continue to the next profile entry.
[in]requestCurrent request.
[in]profile_ctxProfile lookup state.
[in]handlelibldap handle the result was received on.
[in]entryProfile object to apply.

Definition at line 64 of file profile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ldap_profile_search_push()

static unlang_action_t ldap_profile_search_push ( ldap_profile_ctx_t profile_ctx,
request_t request,
char const *  base,
int  scope,
char const *  filter 
)
static

Push the resume frame and start the first profile search.

Cancellation is handled by the frame fr_ldap_trunk_search pushes above this one, which abandons the in-flight query and detaches it from the trunk request before the unwind frees profile_ctx.

Definition at line 232 of file profile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rlm_ldap_map_profile()

unlang_action_t rlm_ldap_map_profile ( fr_ldap_result_code_t ret,
int *  applied,
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.

LDAP profiles are mapped using the same attribute map as user objects, they're used to add common sets of attributes to the request.

Parameters
[out]retWhere to write the result of the query.
[out]appliedWhere to write the number of profiles applied.
[in]instLDAP module instance.
[in]requestCurrent request.
[in]ttrunkTrunk connection on which to run LDAP queries.
[in]dnof profile object to apply.
[in]scopeto apply when looking up profiles.
[in]filterto apply when looking up profiles.
[in]expandedStructure containing a list of xlat expanded attribute names and mapping information.
Returns
One of the RLM_MODULE_* values.

Definition at line 269 of file profile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rlm_ldap_map_profiles()

unlang_action_t rlm_ldap_map_profiles ( fr_ldap_result_code_t ret,
int *  applied,
rlm_ldap_t const *  inst,
request_t request,
fr_ldap_thread_trunk_t ttrunk,
char const *const *  dn_list,
char const *  filter,
fr_ldap_map_exp_t const *  expanded 
)

Search for and apply a set of LDAP profiles.

With search_mode = bulk, a single search retrieves every profile object, matching entries by DN using the attribute configured (or detected) for the directory, and profiles are applied in result order. With search_mode = seq, one search is run per profile DN, applied in list order.

Parameters
[out]retWhere to write the result of the last query.
[out]appliedIncremented by the number of profile maps applied.
[in]instLDAP module instance.
[in]requestCurrent request.
[in]ttrunkTrunk connection on which to run LDAP queries.
[in]dn_listNULL terminated list of profile object DNs to apply, in application order (default profile first). Must contain at least one DN, and no empty strings.
[in]filterto apply when looking up profiles.
[in]expandedStructure containing a list of xlat expanded attribute names and mapping information.
Returns
An unlang_action_t.

Definition at line 311 of file profile.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: