25 RCSID(
"$Id: 8afee84520f0d2c547b6d8c0d5b36d51d7f51d52 $")
27 #include <freeradius-devel/ldap/base.h>
55 PERROR(
"Failed to allocate LDAP referral container");
117 int referral_no = -1;
119 LDAPURLDesc temp_desc;
145 if (!referral)
continue;
147 referral->
query = query;
151 "Failed parsing referral LDAP URL %s", query->
referral_urls[referral_no]);
157 temp_desc = (LDAPURLDesc){
163 referral->
host_uri = ldap_url_desc2str(&temp_desc);
166 "Failed building LDAP host URI from %s", query->
referral_urls[referral_no]);
169 if (
config->use_referral_credentials) {
176 for (ext = referral->
referral_url->lud_exts; ext && *ext; ext++) {
178 bool critical =
false;
196 "Failed parsing extension \"%s\": "
197 "No attribute/value delimiter '='", *ext);
205 if (!p)
goto bad_ext;
212 "Failed parsing critical extension \"%s\": "
213 "Not supported by FreeRADIUS", *ext);
231 "No active LDAP trunk for URI %s, bound as %s",
281 referral->
ttrunk = ttrunk;
372 referral->
ttrunk = ttrunk;
fr_dcursor_eval_t void const * uctx
static void * fr_dlist_talloc_free_item(fr_dlist_head_t *list_head, void *ptr)
Free the item specified.
static void * fr_dlist_next(fr_dlist_head_t const *list_head, void const *ptr)
Get the next item in a list.
static void fr_dlist_talloc_free(fr_dlist_head_t *head)
Free all items in a doubly linked list (with talloc)
static unsigned int fr_dlist_num_elements(fr_dlist_head_t const *head)
Return the number of elements in the dlist.
static int fr_dlist_insert_tail(fr_dlist_head_t *list_head, void *ptr)
Insert an item into the tail of a list.
#define fr_dlist_talloc_init(_head, _type, _field)
Initialise the head structure of a doubly linked list.
void unlang_interpret_mark_runnable(request_t *request)
Mark a request as resumable.
LDAPURLDesc * referral_url
URL for the referral.
char * host_uri
Host URI used for referral connection.
fr_ldap_config_t * config
Module instance config.
char ** referral_urls
Referral results to follow.
uint16_t referral_depth
How many referrals we have followed.
fr_ldap_thread_trunk_t * fr_thread_ldap_trunk_get(fr_ldap_thread_t *thread, char const *uri, char const *bind_dn, char const *bind_password, request_t *request, fr_ldap_config_t const *config)
Find a thread specific LDAP connection for a specific URI / bind DN.
fr_dlist_head_t referrals
List of parsed referrals.
fr_ldap_result_code_t ret
Result code.
request_t * request
Request this referral relates to.
trunk_request_t * treq
Trunk request this query is associated with.
char const * identity
Bind identity for referral connection.
fr_ldap_query_t * query
Query this referral relates to.
@ LDAP_RESULT_ERROR
A general error occurred.
trunk_state_t fr_thread_ldap_trunk_state(fr_ldap_thread_t *thread, char const *uri, char const *bind_dn)
Lookup the state of a thread specific LDAP connection trunk for a specific URI / bind DN.
char const * password
Bind password for referral connection.
trunk_t * trunk
Connection trunk.
fr_ldap_thread_trunk_t * ttrunk
Trunk this referral should use.
fr_ldap_referral_t * referral
Referral actually being followed.
@ LDAP_EXT_BINDPW
Specifies the password for an LDAP bind.
@ LDAP_EXT_UNSUPPORTED
Unsupported extension.
@ LDAP_EXT_BINDNAME
Specifies the user DN or name for an LDAP bind.
Connection configuration.
Parsed LDAP referral structure.
Thread specific structure to manage LDAP trunk connections.
Thread LDAP trunk structure.
fr_table_num_sorted_t const fr_ldap_supported_extensions[]
#define ROPTIONAL(_l_request, _l_global, _fmt,...)
Use different logging functions depending on whether request is NULL or not.
static const conf_parser_t config[]
static int _fr_ldap_referral_free(fr_ldap_referral_t *referral)
Clear up a fr_ldap_referral_t.
int fr_ldap_referral_follow(fr_ldap_thread_t *t, request_t *request, fr_ldap_query_t *query)
Follow an LDAP referral.
int fr_ldap_referral_next(fr_ldap_thread_t *t, request_t *request, fr_ldap_query_t *query)
Follow an alternative LDAP referral.
fr_ldap_referral_t * fr_ldap_referral_alloc(TALLOC_CTX *ctx, request_t *request)
Allocate a new structure to handle an LDAP referral, setting the destructor.
CC_NO_UBSAN(function)
Callback to send LDAP referral queries when a trunk becomes active.
#define fr_table_value_by_substr(_table, _name, _name_len, _def)
Convert a partial string to a value using an ordered or sorted table.
trunk_watch_entry_t * trunk_add_watch(trunk_t *trunk, trunk_state_t state, trunk_watch_t watch, bool oneshot, void const *uctx)
Add a watch entry to the trunk state list.
trunk_enqueue_t trunk_request_enqueue(trunk_request_t **treq_out, trunk_t *trunk, request_t *request, void *preq, void *rctx)
Enqueue a request that needs data written to the trunk.
void trunk_request_signal_complete(trunk_request_t *treq)
Signal that a trunk request is complete.
Main trunk management handle.
@ TRUNK_STATE_ACTIVE
Trunk has active connections.
@ TRUNK_ENQUEUE_OK
Operation was successful.
@ TRUNK_ENQUEUE_IN_BACKLOG
Request should be enqueued in backlog.