All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
groups.c File Reference

LDAP module group functions. More...

#include <freeradius-devel/rad_assert.h>
#include <ctype.h>
#include "ldap.h"
+ Include dependency graph for groups.c:

Go to the source code of this file.

Functions

rlm_rcode_t rlm_ldap_cacheable_groupobj (rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn)
 Convert group membership information into attributes. More...
 
rlm_rcode_t rlm_ldap_cacheable_userobj (rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, LDAPMessage *entry, char const *attr)
 Convert group membership information into attributes. More...
 
rlm_rcode_t rlm_ldap_check_cached (rlm_ldap_t const *inst, REQUEST *request, VALUE_PAIR *check)
 Check group membership attributes to see if a user is a member. More...
 
rlm_rcode_t rlm_ldap_check_groupobj_dynamic (rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, VALUE_PAIR *check)
 Query the LDAP directory to check if a group object includes a user object as a member. More...
 
rlm_rcode_t rlm_ldap_check_userobj_dynamic (rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, char const *dn, VALUE_PAIR *check)
 Query the LDAP directory to check if a user object is a member of a group. More...
 
static rlm_rcode_t rlm_ldap_group_dn2name (rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, char const *dn, char **out)
 Convert a single group name into a DN. More...
 
static rlm_rcode_t rlm_ldap_group_name2dn (rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, char **names, char **out, size_t outlen)
 Convert multiple group names into a DNs. More...
 

Detailed Description

LDAP module group functions.

Id:
f6f79a0000f892613bccc75730d0f49328581e15
Author
Arran Cudbard-Bell a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg

Definition in file groups.c.

Function Documentation

rlm_rcode_t rlm_ldap_cacheable_groupobj ( rlm_ldap_t const *  inst,
REQUEST request,
ldap_handle_t **  pconn 
)

Convert group membership information into attributes.

Parameters
[in]instrlm_ldap configuration.
[in]requestCurrent request.
[in,out]pconnto use. May change as this function calls functions which auto re-connect.
Returns
One of the RLM_MODULE_* values.

Definition at line 415 of file groups.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

rlm_rcode_t rlm_ldap_cacheable_userobj ( rlm_ldap_t const *  inst,
REQUEST request,
ldap_handle_t **  pconn,
LDAPMessage *  entry,
char const *  attr 
)

Convert group membership information into attributes.

Parameters
[in]instrlm_ldap configuration.
[in]requestCurrent request.
[in,out]pconnto use. May change as this function calls functions which auto re-connect.
[in]entryretrieved by rlm_ldap_find_user or rlm_ldap_search.
[in]attrmembership attribute to look for in the entry.
Returns
One of the RLM_MODULE_* values.

Definition at line 267 of file groups.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

rlm_rcode_t rlm_ldap_check_cached ( rlm_ldap_t const *  inst,
REQUEST request,
VALUE_PAIR check 
)

Check group membership attributes to see if a user is a member.

Parameters
[in]instrlm_ldap configuration.
[in]requestCurrent request.
[in]checkvp containing the group value (name or dn).
Returns
One of the RLM_MODULE_* values.

Definition at line 812 of file groups.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

rlm_rcode_t rlm_ldap_check_groupobj_dynamic ( rlm_ldap_t const *  inst,
REQUEST request,
ldap_handle_t **  pconn,
VALUE_PAIR check 
)

Query the LDAP directory to check if a group object includes a user object as a member.

Parameters
[in]instrlm_ldap configuration.
[in]requestCurrent request.
[in,out]pconnto use. May change as this function calls functions which auto re-connect.
[in]checkvp containing the group value (name or dn).
Returns
One of the RLM_MODULE_* values.

Definition at line 530 of file groups.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

rlm_rcode_t rlm_ldap_check_userobj_dynamic ( rlm_ldap_t const *  inst,
REQUEST request,
ldap_handle_t **  pconn,
char const *  dn,
VALUE_PAIR check 
)

Query the LDAP directory to check if a user object is a member of a group.

Parameters
[in]instrlm_ldap configuration.
[in]requestCurrent request.
[in,out]pconnto use. May change as this function calls functions which auto re-connect.
[in]dnof user object.
[in]checkvp containing the group value (name or dn).
Returns
One of the RLM_MODULE_* values.

Definition at line 632 of file groups.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static rlm_rcode_t rlm_ldap_group_dn2name ( rlm_ldap_t const *  inst,
REQUEST request,
ldap_handle_t **  pconn,
char const *  dn,
char **  out 
)
static

Convert a single group name into a DN.

Unlike the inverse conversion of a name to a DN, most LDAP directories don't allow filtering by DN, so we need to search for each DN individually.

Parameters
[in]instrlm_ldap configuration.
[in]requestCurrent request.
[in,out]pconnto use. May change as this function calls functions which auto re-connect.
[in]dnto resolve.
[out]outWhere to write group name (must be freed with talloc_free).
Returns
One of the RLM_MODULE_* values.

Definition at line 196 of file groups.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static rlm_rcode_t rlm_ldap_group_name2dn ( rlm_ldap_t const *  inst,
REQUEST request,
ldap_handle_t **  pconn,
char **  names,
char **  out,
size_t  outlen 
)
static

Convert multiple group names into a DNs.

Given an array of group names, builds a filter matching all names, then retrieves all group objects and stores the DN associated with each group object.

Parameters
[in]instrlm_ldap configuration.
[in]requestCurrent request.
[in,out]pconnto use. May change as this function calls functions which auto re-connect.
[in]namesto covert to DNs (NULL terminated).
[out]outWhere to write the DNs. DNs must be freed with ldap_memfree(). Will be NULL terminated.
[in]outlenSize of out.
Returns
One of the RLM_MODULE_* values.

Definition at line 45 of file groups.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: