16#include <freeradius-devel/server/base.h>
17#include <freeradius-devel/server/module_rlm.h>
18#include <freeradius-devel/ldap/base.h>
36#ifdef LDAP_CONTROL_X_SESSION_TRACKING
37 bool session_tracking;
45 char const *obj_sort_by;
46 LDAPControl *obj_sort_ctrl;
50 char const *obj_access_attr;
54 char const *access_value_negate;
56 char const *access_value_suspend;
61 bool expect_password_is_set;
63 char const *profile_attr;
64 char const *profile_attr_suspend;
67 char const *dn_attr_str;
79 char const *userobj_membership_attr;
81 char const *obj_filter;
84 char const *obj_name_attr;
85 char const *obj_membership_filter;
98 char const *cache_attr_str;
104 char const *attribute;
110 bool allow_dangling_refs;
113 bool skip_on_suspend;
115 char const *profile_attr;
116 char const *profile_attr_suspend;
134 char const *obj_sort_by;
135 LDAPControl *obj_sort_ctrl;
136 char const *check_attr;
138 char const *fallthrough_attr;
141 bool fallthrough_def;
252 switch (access_state) {
283 char const *attrs[2];
310 if (!
vp)
return NULL;
312 RDEBUG2(
"Using user DN from request \"%pV\"", &
vp->data);
313 return vp->vp_strvalue;
348 char const *dn,
int scope,
char const *filter,
fr_ldap_map_exp_t const *expanded);
352 char const *
const *dn_list,
char const *filter,
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
fr_ldap_result_code_t
LDAP query result codes.
Connection configuration.
Result of expanding the RHS of a set of maps.
Thread LDAP trunk structure.
fr_pair_t * fr_pair_find_by_da(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find the first pair with a matching da.
rlm_rcode_t
Return codes indicating the result of the module call.
static char const * rlm_ldap_profile_attr_select(char const *attr, char const *attr_suspend, ldap_access_state_t access_state)
Return the profile attribute matching the user's access state.
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.
ldap_profile_search_mode_t
How profile objects are retrieved from the directory.
@ LDAP_PROFILE_SEARCH_MODE_AUTO
Resolved at instantiation, LDAP_PROFILE_SEARCH_MODE_BULK when server side sorting is configured and t...
@ LDAP_PROFILE_SEARCH_MODE_BULK
A single search retrieving every profile object, applied in result order.
@ LDAP_PROFILE_SEARCH_MODE_SEQ
One search per profile DN, applied in list order.
ldap_xlat_memberof_call_env_t * env_data
fr_ldap_map_exp_t expanded
unlang_action_t rlm_ldap_cacheable_groupobj(unlang_result_t *p_result, request_t *request, ldap_autz_ctx_t *autz_ctx)
Convert group membership information into attributes.
HIDDEN fr_dict_attr_t const * attr_password
fr_pair_list_t * bind_trigger_args
Pairs passed to trigger request for bind trunk.
ldap_autz_call_env_t * call_env
HIDDEN fr_dict_attr_t const * attr_crypt_password
ldap_access_state_t
User's access state.
@ LDAP_ACCESS_SUSPENDED
User account has been suspended.
@ LDAP_ACCESS_ALLOWED
User is allowed to login.
@ LDAP_ACCESS_DISALLOWED
User it not allow to login (disabled)
unlang_action_t rlm_ldap_check_groupobj_dynamic(unlang_result_t *p_result, request_t *request, ldap_group_xlat_ctx_t *xlat_ctx)
Initiate an LDAP search to determine group membership, querying group objects.
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.
fr_ldap_thread_trunk_t * ttrunk
HIDDEN fr_dict_attr_t const * attr_user_name
fr_value_box_t profile_filter
Filter to use when searching for profiles.
fr_value_box_t user_filter
Filter to use when searching for users.
unlang_action_t rlm_ldap_cacheable_userobj(unlang_result_t *p_result, request_t *request, ldap_autz_ctx_t *autz_ctx, char const *attr)
Convert group membership information into attributes.
tmpl_t * group_filter
tmpl to expand as group membership filter.
trunk_conf_t bind_trunk_conf
Trunk configuration for trunk used for bind auths.
HIDDEN fr_dict_attr_t const * attr_nt_password
ldap_autz_status_t
State list for resumption of authorization.
@ LDAP_AUTZ_POST_PROFILES
@ LDAP_AUTZ_GROUP_PROFILES
char const ** profile_dn_list
List of profile DNs to apply, default profile first, then group profiles, then profiles from the user...
ldap_autz_status_t status
char const * valuepair_attr
Generic dynamic mapping attribute, contains a RADIUS attribute and value.
fr_value_box_t profile_child_rdn
RDN of a child object to evaluate below each profile.
unlang_action_t rlm_ldap_check_userobj_dynamic(unlang_result_t *p_result, request_t *request, ldap_group_xlat_ctx_t *xlat_ctx)
Query the LDAP directory to check if a user object is a member of a group.
fr_value_box_t user_base
Base DN in which to search for users.
fr_ldap_config_t handle_config
Connection configuration instance.
HIDDEN fr_dict_attr_t const * attr_user_password
ldap_group_xlat_status_t status
tmpl_t * group_filter
tmpl to expand as group membership filter.
fr_value_box_t group_base
Base DN in which to search for groups.
char const * dn_attr
Attribute to match an entry's DN in a search filter.
ldap_access_state_t access_state
What state a user's account is in.
unlang_action_t rlm_ldap_find_user_async(TALLOC_CTX *ctx, unlang_result_t *p_result, rlm_ldap_t const *inst, request_t *request, fr_value_box_t *base, fr_value_box_t *filter_box, fr_ldap_thread_trunk_t *ttrunk, char const *attrs[], fr_ldap_query_t **query_out)
Initiate asynchronous retrieval of the DN of a user object.
fr_value_box_t user_base
Base DN in which to search for users.
int profiles_applied
Number of profile maps applied.
HIDDEN fr_dict_attr_t const * attr_password_with_header
fr_ldap_thread_trunk_t * ttrunk
fr_value_box_t group_base
Base DN in which to search for groups.
map_list_t * user_map
Attribute map applied to users and profiles.
rlm_rcode_t rcode
What rcode we'll finally respond with.
static char const * rlm_find_user_dn_cached(rlm_ldap_t const *inst, request_t *request)
talloc_str_list_t * group_profile_dn_list
Profile DNs found in the user's group objects.
trunk_conf_t trunk_conf
Trunk configuration.
module_instance_t const * mi
Module instance data for thread lookups.
void rlm_ldap_check_reply(request_t *request, rlm_ldap_t const *inst, char const *inst_name, bool expect_password, fr_ldap_thread_trunk_t const *ttrunk)
Verify we got a password from the search.
fr_value_box_t const * expect_password
True if the user_map included a mapping between an LDAP attribute and one of our password reference a...
unlang_action_t rlm_ldap_group_profiles(unlang_result_t *p_result, request_t *request, ldap_autz_ctx_t *autz_ctx)
Search for profile DNs in the group objects the user is a member of.
unlang_action_t rlm_ldap_check_cached(unlang_result_t *p_result, rlm_ldap_t const *inst, request_t *request, fr_value_box_t const *check)
Check group membership attributes to see if a user is a member.
fr_pair_list_t * trigger_args
Pairs passed to trigger request for standard trunk.
fr_value_box_t user_filter
Filter to use when searching for users.
fr_value_box_t default_profile
If this is set, we will search for a profile object with this name, and map any attributes it contain...
ldap_group_xlat_status_t
State list for xlat evaluation of LDAP group membership.
HIDDEN fr_dict_attr_t const * attr_cleartext_password
talloc_str_list_t * group_dn_list
DNs of the group objects the user is a member of.
module_instance_t const * dlinst
ldap_access_state_t rlm_ldap_check_access(rlm_ldap_t const *inst, request_t *request, LDAPMessage *entry)
Check for presence of access attribute in result.
Call environment used in LDAP authorization.
Holds state of in progress async authorization.
Holds state of in progress group membership check xlat.
Call environment used in group membership xlat.
eap_aka_sim_process_conf_t * inst
Stores an attribute, a value and various bits of other data.
A NULL terminated array of strings with an append cursor.
Common configuration parameters for a trunk.
static TALLOC_CTX * xlat_ctx