The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Functions
map.c File Reference

Functions for mapping between LDAP and FreeRADIUS attributes. More...

#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/ldap/base.h>
+ Include dependency graph for map.c:

Go to the source code of this file.

Functions

int fr_ldap_map_do (request_t *request, char const *check_attr, char const *valuepair_attr, fr_ldap_map_exp_t const *expanded, LDAPMessage *entry)
 Convert attribute map into valuepairs.
 
int fr_ldap_map_expand (TALLOC_CTX *ctx, fr_ldap_map_exp_t *expanded, request_t *request, map_list_t const *maps, char const *generic_attr, char const *check_attr)
 Expand values in an attribute map where needed.
 
USES_APPLE_DEPRECATED_API int fr_ldap_map_getvalue (TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, map_t const *map, void *uctx)
 Callback for map_to_request.
 
int fr_ldap_map_verify (map_t *map, UNUSED void *instance)
 

Detailed Description

Functions for mapping between LDAP and FreeRADIUS attributes.

Id
95b77b350bdcbc8a37e4018ca150beb6db433195
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 map.c.

Function Documentation

◆ fr_ldap_map_do()

int fr_ldap_map_do ( request_t request,
char const *  check_attr,
char const *  valuepair_attr,
fr_ldap_map_exp_t const *  expanded,
LDAPMessage *  entry 
)

Convert attribute map into valuepairs.

Use the attribute map built earlier to convert LDAP values into valuepairs and insert them into whichever list they need to go into.

This is NOT atomic, but there's no condition for which we should error out...

Parameters
[in]requestCurrent request.
[in]check_attrTreat attribute with this name as a condition to process the map.
[in]valuepair_attrTreat attribute with this name as holding complete AVP definitions.
[in]expandedattributes (rhs of map).
[in]entryto retrieve attributes from.
Returns
  • Number of maps successfully applied.
  • -1 on failure.

Definition at line 327 of file map.c.

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

◆ fr_ldap_map_expand()

int fr_ldap_map_expand ( TALLOC_CTX *  ctx,
fr_ldap_map_exp_t expanded,
request_t request,
map_list_t const *  maps,
char const *  generic_attr,
char const *  check_attr 
)

Expand values in an attribute map where needed.

Parameters
[in]ctxo allocate any dynamic expansions in.
[out]expandedarray of attributes. Need not be initialised (we'll initialise).
[in]requestThe current request.
[in]mapsto expand.
[in]generic_attrname to append to the attribute list.
[in]check_attrname to append to the attribute list.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 272 of file map.c.

+ Here is the caller graph for this function:

◆ fr_ldap_map_getvalue()

USES_APPLE_DEPRECATED_API int fr_ldap_map_getvalue ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
request_t request,
map_t const *  map,
void *  uctx 
)

Callback for map_to_request.

Performs exactly the same job as map_to_vp, but pulls attribute values from LDAP entries

See also
map_to_vp

Definition at line 39 of file map.c.

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

◆ fr_ldap_map_verify()

int fr_ldap_map_verify ( map_t map,
UNUSED void *  instance 
)

Definition at line 200 of file map.c.

+ Here is the call graph for this function: