From: Arran Cudbard-Bell Date: Wed, 26 Apr 2017 02:03:02 +0000 (-0400) Subject: s/ldap_handle_t/fr_ldap_conn_t/ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbd4a245fc5388bade135ac148732dbdc1146a9c;p=thirdparty%2Ffreeradius-server.git s/ldap_handle_t/fr_ldap_conn_t/ --- diff --git a/src/lib/ldap/control.c b/src/lib/ldap/control.c index 850f2102977..d08643bf9e8 100644 --- a/src/lib/ldap/control.c +++ b/src/lib/ldap/control.c @@ -42,7 +42,7 @@ LDAPControl *clientctrls_out[], size_t serverctrls_len, size_t clientctrls_len, - ldap_handle_t *conn, + fr_ldap_conn_t *conn, LDAPControl *serverctrls_in[], LDAPControl *clientctrls_in[]) { @@ -83,7 +83,7 @@ * - 0 on success. * - -1 on failure (exceeded maximum controls). */ -int fr_ldap_control_add_server(ldap_handle_t *conn, LDAPControl *ctrl, bool freeit) +int fr_ldap_control_add_server(fr_ldap_conn_t *conn, LDAPControl *ctrl, bool freeit) { if ((size_t)conn->serverctrls_cnt >= ((sizeof(conn->serverctrls) / sizeof(conn->serverctrls[0])) - 1)) { return -1; @@ -107,7 +107,7 @@ int fr_ldap_control_add_server(ldap_handle_t *conn, LDAPControl *ctrl, bool free * - 0 on success. * - -1 on failure (exceeded maximum controls). */ -int fr_ldap_control_add_client(ldap_handle_t *conn, LDAPControl *ctrl, bool freeit) +int fr_ldap_control_add_client(fr_ldap_conn_t *conn, LDAPControl *ctrl, bool freeit) { if ((size_t)conn->clientctrls_cnt >= ((sizeof(conn->clientctrls) / sizeof(conn->clientctrls[0])) - 1)) { return -1; @@ -124,7 +124,7 @@ int fr_ldap_control_add_client(ldap_handle_t *conn, LDAPControl *ctrl, bool free * * @param conn to clear controls from. */ -void fr_ldap_control_clear(ldap_handle_t *conn) +void fr_ldap_control_clear(fr_ldap_conn_t *conn) { int i; @@ -158,7 +158,7 @@ void fr_ldap_control_clear(ldap_handle_t *conn) * @param conn to add controls to. * @param request to draw attributes from. */ -int fr_ldap_control_add_session_tracking(ldap_handle_t *conn, REQUEST *request) +int fr_ldap_control_add_session_tracking(fr_ldap_conn_t *conn, REQUEST *request) { /* * The OpenLDAP guys didn't declare the formatOID parameter to diff --git a/src/lib/ldap/directory.c b/src/lib/ldap/directory.c index f40a4e53cd6..69f107daddb 100644 --- a/src/lib/ldap/directory.c +++ b/src/lib/ldap/directory.c @@ -55,7 +55,7 @@ static FR_NAME_NUMBER const fr_ldap_directory_type_table[] = { * - 1 if we failed identifying the directory server. * - -1 on error. */ -int fr_ldap_directory_alloc(TALLOC_CTX *ctx, fr_ldap_directory_t **out, ldap_handle_t **pconn) +int fr_ldap_directory_alloc(TALLOC_CTX *ctx, fr_ldap_directory_t **out, fr_ldap_conn_t **pconn) { static char const *attrs[] = { "vendorname", "vendorversion", diff --git a/src/lib/ldap/libfreeradius-ldap.c b/src/lib/ldap/libfreeradius-ldap.c index 2b0571f0f1f..08cf64e6ef6 100644 --- a/src/lib/ldap/libfreeradius-ldap.c +++ b/src/lib/ldap/libfreeradius-ldap.c @@ -89,7 +89,7 @@ FR_NAME_NUMBER const fr_ldap_dereference[] = { * There are so many different timers in LDAP it's often hard to debug * issues with them, hence the need for this function. */ -void fr_ldap_timeout_debug(REQUEST *request, ldap_handle_t const *conn, +void fr_ldap_timeout_debug(REQUEST *request, fr_ldap_conn_t const *conn, struct timeval const *timeout, char const *prefix) { struct timeval *net = NULL, *client = NULL; @@ -153,7 +153,7 @@ void fr_ldap_timeout_debug(REQUEST *request, ldap_handle_t const *conn, * @param conn to retrieve error from. * @return error string. */ -char const *fr_ldap_error_str(ldap_handle_t const *conn) +char const *fr_ldap_error_str(fr_ldap_conn_t const *conn) { int lib_errno; ldap_get_option(conn->handle, LDAP_OPT_ERROR_NUMBER, &lib_errno); @@ -175,7 +175,7 @@ char const *fr_ldap_error_str(ldap_handle_t const *conn) * @param[in] dn if processing the result from a search request. * @return One of the LDAP_PROC_* (#fr_ldap_rcode_t) values. */ -fr_ldap_rcode_t fr_ldap_error_check(LDAPControl ***ctrls, ldap_handle_t const *conn, LDAPMessage *msg, char const *dn) +fr_ldap_rcode_t fr_ldap_error_check(LDAPControl ***ctrls, fr_ldap_conn_t const *conn, LDAPMessage *msg, char const *dn) { fr_ldap_rcode_t status = LDAP_PROC_SUCCESS; @@ -384,7 +384,7 @@ process_error: * @return One of the LDAP_PROC_* (#fr_ldap_rcode_t) values. */ fr_ldap_rcode_t fr_ldap_result(LDAPMessage **result, LDAPControl ***ctrls, - ldap_handle_t const *conn, int msgid, int all, + fr_ldap_conn_t const *conn, int msgid, int all, char const *dn, struct timeval const *timeout) { @@ -467,7 +467,7 @@ fr_ldap_rcode_t fr_ldap_result(LDAPMessage **result, LDAPControl ***ctrls, * @return One of the LDAP_PROC_* (#fr_ldap_rcode_t) values. */ fr_ldap_rcode_t fr_ldap_bind(REQUEST *request, - ldap_handle_t **pconn, + fr_ldap_conn_t **pconn, char const *dn, char const *password, #ifdef WITH_SASL fr_ldap_sasl_t const *sasl, @@ -566,7 +566,7 @@ fr_ldap_rcode_t fr_ldap_bind(REQUEST *request, * @return One of the LDAP_PROC_* (#fr_ldap_rcode_t) values. */ fr_ldap_rcode_t fr_ldap_search(LDAPMessage **result, REQUEST *request, - ldap_handle_t **pconn, + fr_ldap_conn_t **pconn, char const *dn, int scope, char const *filter, char const * const *attrs, LDAPControl **serverctrls, LDAPControl **clientctrls) { @@ -694,7 +694,7 @@ finish: * @return One of the LDAP_PROC_* (#fr_ldap_rcode_t) values. */ fr_ldap_rcode_t fr_ldap_search_async(int *msgid, REQUEST *request, - ldap_handle_t **pconn, + fr_ldap_conn_t **pconn, char const *dn, int scope, char const *filter, char const * const *attrs, LDAPControl **serverctrls, LDAPControl **clientctrls) { @@ -777,7 +777,7 @@ fr_ldap_rcode_t fr_ldap_search_async(int *msgid, REQUEST *request, * @param[in] clientctrls Search controls for ldap_modify. May be NULL. * @return One of the LDAP_PROC_* (#fr_ldap_rcode_t) values. */ -fr_ldap_rcode_t fr_ldap_modify(REQUEST *request, ldap_handle_t **pconn, +fr_ldap_rcode_t fr_ldap_modify(REQUEST *request, fr_ldap_conn_t **pconn, char const *dn, LDAPMod *mods[], LDAPControl **serverctrls, LDAPControl **clientctrls) { @@ -852,7 +852,7 @@ static int fr_ldap_rebind(LDAP *handle, LDAP_CONST char *url, UNUSED ber_tag_t request, UNUSED ber_int_t msgid, void *ctx) { fr_ldap_rcode_t status; - ldap_handle_t *conn = talloc_get_type_abort(ctx, ldap_handle_t); + fr_ldap_conn_t *conn = talloc_get_type_abort(ctx, fr_ldap_conn_t); fr_ldap_handle_config_t const *handle_config = conn->config; char const *admin_identity = NULL; @@ -959,7 +959,7 @@ static int fr_ldap_rebind(LDAP *handle, LDAP_CONST char *url, * @param conn to destroy. * @return always indicates success. */ -static int _mod_conn_free(ldap_handle_t *conn) +static int _mod_conn_free(fr_ldap_conn_t *conn) { fr_ldap_handle_config_t const *handle_config = conn->config; @@ -999,9 +999,9 @@ static int _mod_conn_free(ldap_handle_t *conn) * - A new handle on success. * - NULL on error. */ -ldap_handle_t *fr_ldap_conn_alloc(TALLOC_CTX *ctx, fr_ldap_handle_config_t const *handle_config) +fr_ldap_conn_t *fr_ldap_conn_alloc(TALLOC_CTX *ctx, fr_ldap_handle_config_t const *handle_config) { - ldap_handle_t *conn; + fr_ldap_conn_t *conn; LDAP *handle = NULL; int ldap_errno, ldap_version; @@ -1027,7 +1027,7 @@ ldap_handle_t *fr_ldap_conn_alloc(TALLOC_CTX *ctx, fr_ldap_handle_config_t const /* * Allocate memory for the handle. */ - conn = talloc_zero(ctx, ldap_handle_t); + conn = talloc_zero(ctx, fr_ldap_conn_t); if (!conn) return NULL; conn->config = handle_config; @@ -1162,7 +1162,7 @@ error: return NULL; } -int fr_ldap_conn_timeout_set(ldap_handle_t const *conn, struct timeval const *timeout) +int fr_ldap_conn_timeout_set(fr_ldap_conn_t const *conn, struct timeval const *timeout) { int ldap_errno; fr_ldap_handle_config_t const *handle_config = conn->config; @@ -1190,7 +1190,7 @@ error: return -1; } -int fr_ldap_conn_timeout_reset(ldap_handle_t const *conn) +int fr_ldap_conn_timeout_reset(fr_ldap_conn_t const *conn) { int ldap_errno; fr_ldap_handle_config_t const *handle_config = conn->config; diff --git a/src/lib/ldap/map.c b/src/lib/ldap/map.c index 8d056b02655..bf074594d31 100644 --- a/src/lib/ldap/map.c +++ b/src/lib/ldap/map.c @@ -266,7 +266,7 @@ int fr_ldap_map_expand(fr_ldap_map_exp_t *expanded, REQUEST *request, vp_map_t c * - Number of maps successfully applied. * - -1 on failure. */ -int fr_ldap_map_do(REQUEST *request, ldap_handle_t *conn, +int fr_ldap_map_do(REQUEST *request, fr_ldap_conn_t *conn, char const *valuepair_attr, fr_ldap_map_exp_t const *expanded, LDAPMessage *entry) { vp_map_t const *map; diff --git a/src/lib/ldap/sasl.c b/src/lib/ldap/sasl.c index e8b613bc092..fe64d1712ba 100644 --- a/src/lib/ldap/sasl.c +++ b/src/lib/ldap/sasl.c @@ -43,7 +43,7 @@ typedef struct fr_ldap_sasl_t_ctx_t { fr_ldap_sasl_t const *extra; //!< Extra fields (realm and proxy id). - ldap_handle_t *conn; //!< Connection in use. + fr_ldap_conn_t *conn; //!< Connection in use. } fr_ldap_sasl_ctx_t; /** Callback for fr_ldap_sasl_interactive_bind @@ -105,7 +105,7 @@ static int _sasl_interact(UNUSED LDAP *handle, UNUSED unsigned flags, void *ctx, * @return One of the LDAP_PROC_* (#fr_ldap_rcode_t) values. */ fr_ldap_rcode_t fr_ldap_sasl_interactive(REQUEST *request, - ldap_handle_t *conn, char const *identity, + fr_ldap_conn_t *conn, char const *identity, char const *password, fr_ldap_sasl_t const *sasl, LDAPControl **serverctrls, LDAPControl **clientctrls, struct timeval const *timeout) diff --git a/src/lib/ldap/util.c b/src/lib/ldap/util.c index 6490038a26d..1412f61cf9a 100644 --- a/src/lib/ldap/util.c +++ b/src/lib/ldap/util.c @@ -265,7 +265,7 @@ bool fr_ldap_util_is_dn(char const *in, size_t inlen) * - 0 on success. * - -1 on failure. */ -int fr_ldap_parse_url_extensions(LDAPControl **sss, REQUEST *request, ldap_handle_t *conn, char **extensions) +int fr_ldap_parse_url_extensions(LDAPControl **sss, REQUEST *request, fr_ldap_conn_t *conn, char **extensions) { int i; diff --git a/src/modules/proto_ldap_sync/proto_ldap_sync.c b/src/modules/proto_ldap_sync/proto_ldap_sync.c index e4ac0c8b5ed..60cc4aee2ad 100644 --- a/src/modules/proto_ldap_sync/proto_ldap_sync.c +++ b/src/modules/proto_ldap_sync/proto_ldap_sync.c @@ -55,7 +55,7 @@ typedef struct { fr_ipaddr_t src_ipaddr; //!< Our src interface. uint16_t src_port; //!< Our src port. - ldap_handle_t *conn; //!< Our connection to the LDAP directory. + fr_ldap_conn_t *conn; //!< Our connection to the LDAP directory. RADCLIENT *client; //!< Fake client representing the connection. @@ -568,7 +568,7 @@ static void proto_ldap_conn_init(UNUSED fr_event_list_t *el, UNUSED struct timev * @param[in] user_ctx The listener. * @return 0. */ -static int _proto_ldap_refresh_required(ldap_handle_t *conn, sync_config_t const *config, +static int _proto_ldap_refresh_required(fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, UNUSED sync_phases_t phase, void *user_ctx) { rad_listen_t *listen = talloc_get_type_abort(user_ctx, rad_listen_t); @@ -598,7 +598,7 @@ static int _proto_ldap_refresh_required(ldap_handle_t *conn, sync_config_t const * @param[in] user_ctx The listener. * @return 0. */ -static int _proto_ldap_present(ldap_handle_t *conn, sync_config_t const *config, +static int _proto_ldap_present(fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, sync_phases_t phase, void *user_ctx) { rad_listen_t *listen = talloc_get_type_abort(user_ctx, rad_listen_t); @@ -629,7 +629,7 @@ static int _proto_ldap_present(ldap_handle_t *conn, sync_config_t const *config, * - 0 on success. * - -1 on failure */ -static int _proto_ldap_cookie_store(UNUSED ldap_handle_t *conn, sync_config_t const *config, +static int _proto_ldap_cookie_store(UNUSED fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, uint8_t const *cookie, void *user_ctx) { rad_listen_t *listen = talloc_get_type_abort(user_ctx, rad_listen_t); @@ -669,7 +669,7 @@ static int _proto_ldap_cookie_store(UNUSED ldap_handle_t *conn, sync_config_t co * - 0 on success. * - -1 on failure. */ -static int _proto_ldap_entry(ldap_handle_t *conn, sync_config_t const *config, +static int _proto_ldap_entry(fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, UNUSED sync_phases_t phase, UNUSED uint8_t const uuid[SYNC_UUID_LENGTH], LDAPMessage *msg, sync_states_t state, void *user_ctx) diff --git a/src/modules/proto_ldap_sync/sync.c b/src/modules/proto_ldap_sync/sync.c index 22186aaa1c1..ce564a44b54 100644 --- a/src/modules/proto_ldap_sync/sync.c +++ b/src/modules/proto_ldap_sync/sync.c @@ -33,7 +33,7 @@ #include "sync.h" struct sync_state_s { - ldap_handle_t *conn; + fr_ldap_conn_t *conn; sync_config_t const *config; @@ -706,7 +706,7 @@ static int sync_search_result(sync_state_t *sync, LDAPMessage *msg, LDAPControl * - -1 on sync error. * - -2 on conn error. Requires the handle to be destroyed. */ -int sync_demux(int *sync_id, ldap_handle_t *conn) +int sync_demux(int *sync_id, fr_ldap_conn_t *conn) { struct timeval poll = { 1, 0 }; /* Poll */ LDAPMessage *msg, *head = NULL; @@ -850,7 +850,7 @@ int sync_demux(int *sync_id, ldap_handle_t *conn) static int _sync_state_free(sync_state_t *sync) { - ldap_handle_t *conn = talloc_get_type_abort(sync->conn, ldap_handle_t); /* check for premature free */ + fr_ldap_conn_t *conn = talloc_get_type_abort(sync->conn, fr_ldap_conn_t); /* check for premature free */ rbtree_t *tree = talloc_get_type_abort(conn->user_ctx, rbtree_t); sync_state_t find = { .msgid = sync->msgid }; @@ -896,7 +896,7 @@ static int _sync_cmp(void const *one, void const *two) * @param[in] conn the connection. * @param[in] msgid of the sync to destroy. */ -void sync_state_destroy(ldap_handle_t *conn, int msgid) +void sync_state_destroy(fr_ldap_conn_t *conn, int msgid) { sync_state_t find, *sync; rbtree_t *tree; @@ -916,7 +916,7 @@ void sync_state_destroy(ldap_handle_t *conn, int msgid) * @param[in] conn the connection. * @param[in] msgid of the sync to return the config for. */ -sync_config_t const *sync_state_config_get(ldap_handle_t *conn, int msgid) +sync_config_t const *sync_state_config_get(fr_ldap_conn_t *conn, int msgid) { sync_state_t find, *sync; rbtree_t *tree; @@ -961,7 +961,7 @@ sync_config_t const *sync_state_config_get(ldap_handle_t *conn, int msgid) * @param[in] reload_hint If true, hint to the server that we need to be sent all * entries in the directory. */ -int sync_state_init(ldap_handle_t *conn, sync_config_t const *config, +int sync_state_init(fr_ldap_conn_t *conn, sync_config_t const *config, uint8_t const *cookie, bool reload_hint) { static char const *sync_ctl_oid = LDAP_CONTROL_SYNC; diff --git a/src/modules/proto_ldap_sync/sync.h b/src/modules/proto_ldap_sync/sync.h index 966506968c2..35a3745f2cd 100644 --- a/src/modules/proto_ldap_sync/sync.h +++ b/src/modules/proto_ldap_sync/sync.h @@ -71,7 +71,7 @@ typedef struct sync_config_s sync_config_t; * - 0 on success. * - -1 on error. */ -typedef int (*sync_new_cookie_t)(ldap_handle_t *conn, sync_config_t const *config, +typedef int (*sync_new_cookie_t)(fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, uint8_t const *cookie, void *user_ctx); /** Informed that the refresh phase has changed @@ -87,7 +87,7 @@ typedef int (*sync_new_cookie_t)(ldap_handle_t *conn, sync_config_t const *confi * - 0 on success. * - -1 on error. */ -typedef int (*sync_phase_change_t)(ldap_handle_t *conn, sync_config_t const *config, +typedef int (*sync_phase_change_t)(fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, sync_phases_t phase, void *user_ctx); /** Received an e-syncRefreshRequired error code @@ -104,7 +104,7 @@ typedef int (*sync_phase_change_t)(ldap_handle_t *conn, sync_config_t const *con * - 0 on success. * - -1 on error. */ -typedef int (*sync_refresh_required_t)(ldap_handle_t *conn, sync_config_t const *config, +typedef int (*sync_refresh_required_t)(fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, sync_phases_t phase, void *user_ctx); /** Received an update for en entry @@ -121,7 +121,7 @@ typedef int (*sync_refresh_required_t)(ldap_handle_t *conn, sync_config_t const * - 0 on success. * - -1 on error. */ -typedef int (*sync_entry_t)(ldap_handle_t *conn, sync_config_t const *config, +typedef int (*sync_entry_t)(fr_ldap_conn_t *conn, sync_config_t const *config, int sync_id, sync_phases_t phase, uint8_t const uuid[SYNC_UUID_LENGTH], LDAPMessage *msg, sync_states_t state, void *user_ctx); @@ -176,11 +176,11 @@ extern FR_NAME_NUMBER sync_phase_table[]; extern FR_NAME_NUMBER sync_protocol_op_table[]; extern FR_NAME_NUMBER sync_info_tag_table[]; -int sync_demux(int *sync_id, ldap_handle_t *conn); +int sync_demux(int *sync_id, fr_ldap_conn_t *conn); -void sync_state_destroy(ldap_handle_t *conn, int msgid); +void sync_state_destroy(fr_ldap_conn_t *conn, int msgid); -sync_config_t const *sync_state_config_get(ldap_handle_t *conn, int msgid); +sync_config_t const *sync_state_config_get(fr_ldap_conn_t *conn, int msgid); -int sync_state_init(ldap_handle_t *conn, sync_config_t const *config, +int sync_state_init(fr_ldap_conn_t *conn, sync_config_t const *config, uint8_t const *cookie, bool reload_hint); diff --git a/src/modules/rlm_ldap/clients.c b/src/modules/rlm_ldap/clients.c index 272ef227a41..a581c22ef4f 100644 --- a/src/modules/rlm_ldap/clients.c +++ b/src/modules/rlm_ldap/clients.c @@ -71,7 +71,7 @@ static int rlm_ldap_client_get_attrs(char const **values, int *idx, CONF_SECTION } typedef struct ldap_client_data { - ldap_handle_t *conn; + fr_ldap_conn_t *conn; LDAPMessage *entry; } ldap_client_data_t; @@ -106,7 +106,7 @@ int rlm_ldap_client_load(rlm_ldap_t const *inst, CONF_SECTION *tmpl, CONF_SECTIO { int ret = 0; fr_ldap_rcode_t status; - ldap_handle_t *conn = NULL; + fr_ldap_conn_t *conn = NULL; char const **attrs = NULL; diff --git a/src/modules/rlm_ldap/conn.c b/src/modules/rlm_ldap/conn.c index b67ac26707a..14fcab79f54 100644 --- a/src/modules/rlm_ldap/conn.c +++ b/src/modules/rlm_ldap/conn.c @@ -39,9 +39,9 @@ RCSID("$Id$") * @param inst rlm_ldap configuration. * @param request Current request (may be NULL). */ -ldap_handle_t *mod_conn_get(rlm_ldap_t const *inst, REQUEST *request) +fr_ldap_conn_t *mod_conn_get(rlm_ldap_t const *inst, REQUEST *request) { - ldap_handle_t *conn; + fr_ldap_conn_t *conn; conn = fr_connection_get(inst->pool, request); @@ -72,7 +72,7 @@ ldap_handle_t *mod_conn_get(rlm_ldap_t const *inst, REQUEST *request) * @param request The current request. * @param conn to release. */ -void mod_conn_release(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t *conn) +void mod_conn_release(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t *conn) { /* * Could have already been free'd due to a previous error. @@ -110,7 +110,7 @@ void mod_conn_release(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t *c void *mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval const *timeout) { fr_ldap_rcode_t status; - ldap_handle_t *conn; + fr_ldap_conn_t *conn; fr_ldap_handle_config_t const *handle_config = instance; /* Not talloced */ conn = fr_ldap_conn_alloc(ctx, handle_config); diff --git a/src/modules/rlm_ldap/groups.c b/src/modules/rlm_ldap/groups.c index a7ef6d41cc4..30b104b3c5c 100644 --- a/src/modules/rlm_ldap/groups.c +++ b/src/modules/rlm_ldap/groups.c @@ -45,7 +45,7 @@ * @param[in] outlen Size of out. * @return One of the RLM_MODULE_* values. */ -static rlm_rcode_t rlm_ldap_group_name2dn(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +static rlm_rcode_t rlm_ldap_group_name2dn(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, char **names, char **out, size_t outlen) { rlm_rcode_t rcode = RLM_MODULE_OK; @@ -193,7 +193,7 @@ finish: * @return One of the RLM_MODULE_* values. */ static rlm_rcode_t rlm_ldap_group_dn2name(rlm_ldap_t const *inst, REQUEST *request, - ldap_handle_t **pconn, char const *dn, char **out) + fr_ldap_conn_t **pconn, char const *dn, char **out) { rlm_rcode_t rcode = RLM_MODULE_OK; fr_ldap_rcode_t status; @@ -263,7 +263,7 @@ finish: * @param[in] attr membership attribute to look for in the entry. * @return One of the RLM_MODULE_* values. */ -rlm_rcode_t rlm_ldap_cacheable_userobj(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +rlm_rcode_t rlm_ldap_cacheable_userobj(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, LDAPMessage *entry, char const *attr) { rlm_rcode_t rcode = RLM_MODULE_OK; @@ -411,7 +411,7 @@ rlm_rcode_t rlm_ldap_cacheable_userobj(rlm_ldap_t const *inst, REQUEST *request, * @param[in,out] pconn to use. May change as this function calls functions which auto re-connect. * @return One of the RLM_MODULE_* values. */ -rlm_rcode_t rlm_ldap_cacheable_groupobj(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn) +rlm_rcode_t rlm_ldap_cacheable_groupobj(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn) { rlm_rcode_t rcode = RLM_MODULE_OK; fr_ldap_rcode_t status; @@ -528,7 +528,7 @@ finish: * @param[in] check vp containing the group value (name or dn). * @return One of the RLM_MODULE_* values. */ -rlm_rcode_t rlm_ldap_check_groupobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +rlm_rcode_t rlm_ldap_check_groupobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, VALUE_PAIR *check) { @@ -630,7 +630,7 @@ rlm_rcode_t rlm_ldap_check_groupobj_dynamic(rlm_ldap_t const *inst, REQUEST *req * @param[in] check vp containing the group value (name or dn). * @return One of the RLM_MODULE_* values. */ -rlm_rcode_t rlm_ldap_check_userobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +rlm_rcode_t rlm_ldap_check_userobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, char const *dn, VALUE_PAIR *check) { rlm_rcode_t rcode = RLM_MODULE_NOTFOUND, ret; diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 9f56e0c2328..6a1061d3ff8 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -263,7 +263,7 @@ static ssize_t ldap_xlat(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen, struct berval **values; - ldap_handle_t *conn; + fr_ldap_conn_t *conn; int ldap_errno; char const *url; @@ -397,7 +397,7 @@ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, REQUEST vp_map_t const *map; char *url_str; - ldap_handle_t *conn; + fr_ldap_conn_t *conn; LDAPControl *server_ctrls[] = { NULL, NULL }; @@ -554,7 +554,7 @@ static int rlm_ldap_groupcmp(void *instance, REQUEST *request, UNUSED VALUE_PAIR bool found = false; bool check_is_dn; - ldap_handle_t *conn = NULL; + fr_ldap_conn_t *conn = NULL; char const *user_dn; rad_assert(inst->groupobj_base_dn); @@ -665,7 +665,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, UNUSED void fr_ldap_rcode_t status; char const *dn; rlm_ldap_t const *inst = instance; - ldap_handle_t *conn; + fr_ldap_conn_t *conn; char sasl_mech_buff[LDAP_MAX_DN_STR_LEN]; char sasl_proxy_buff[LDAP_MAX_DN_STR_LEN]; @@ -801,7 +801,7 @@ finish: information. * @return One of the RLM_MODULE_* values. */ -static rlm_rcode_t rlm_ldap_map_profile(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +static rlm_rcode_t rlm_ldap_map_profile(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, char const *dn, fr_ldap_map_exp_t const *expanded) { rlm_rcode_t rcode = RLM_MODULE_OK; @@ -872,7 +872,7 @@ static rlm_rcode_t mod_authorize(void *instance, UNUSED void *thread, REQUEST *r rlm_ldap_t const *inst = instance; struct berval **values; VALUE_PAIR *vp; - ldap_handle_t *conn; + fr_ldap_conn_t *conn; LDAPMessage *result, *entry; char const *dn = NULL; fr_ldap_map_exp_t expanded; /* faster than allocing every time */ @@ -1115,7 +1115,7 @@ static rlm_rcode_t user_modify(rlm_ldap_t const *inst, REQUEST *request, ldap_ac rlm_rcode_t rcode = RLM_MODULE_OK; fr_ldap_rcode_t status; - ldap_handle_t *conn = NULL; + fr_ldap_conn_t *conn = NULL; LDAPMod *mod_p[LDAP_MAX_ATTRMAP + 1], mod_s[LDAP_MAX_ATTRMAP]; LDAPMod **modify = mod_p; diff --git a/src/modules/rlm_ldap/rlm_ldap.h b/src/modules/rlm_ldap/rlm_ldap.h index 164f5f707fe..37ce9e7de69 100644 --- a/src/modules/rlm_ldap/rlm_ldap.h +++ b/src/modules/rlm_ldap/rlm_ldap.h @@ -163,26 +163,26 @@ struct ldap_inst_s { /* * user.c - User lookup functions */ -char const *rlm_ldap_find_user(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +char const *rlm_ldap_find_user(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, char const *attrs[], bool force, LDAPMessage **result, rlm_rcode_t *rcode); rlm_rcode_t rlm_ldap_check_access(rlm_ldap_t const *inst, REQUEST *request, - ldap_handle_t const *conn, LDAPMessage *entry); + fr_ldap_conn_t const *conn, LDAPMessage *entry); -void rlm_ldap_check_reply(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t const *conn); +void rlm_ldap_check_reply(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t const *conn); /* * groups.c - Group membership functions. */ -rlm_rcode_t rlm_ldap_cacheable_userobj(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +rlm_rcode_t rlm_ldap_cacheable_userobj(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, LDAPMessage *entry, char const *attr); -rlm_rcode_t rlm_ldap_cacheable_groupobj(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn); +rlm_rcode_t rlm_ldap_cacheable_groupobj(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn); -rlm_rcode_t rlm_ldap_check_groupobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +rlm_rcode_t rlm_ldap_check_groupobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, VALUE_PAIR *check); -rlm_rcode_t rlm_ldap_check_userobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +rlm_rcode_t rlm_ldap_check_userobj_dynamic(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, char const *dn, VALUE_PAIR *check); rlm_rcode_t rlm_ldap_check_cached(rlm_ldap_t const *inst, REQUEST *request, VALUE_PAIR *check); @@ -190,9 +190,9 @@ rlm_rcode_t rlm_ldap_check_cached(rlm_ldap_t const *inst, REQUEST *request, VALU /* * conn.c - Connection wrappers. */ -ldap_handle_t *mod_conn_get(rlm_ldap_t const *inst, REQUEST *request); +fr_ldap_conn_t *mod_conn_get(rlm_ldap_t const *inst, REQUEST *request); -void mod_conn_release(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t *conn); +void mod_conn_release(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t *conn); void *mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval const *timeout); diff --git a/src/modules/rlm_ldap/user.c b/src/modules/rlm_ldap/user.c index 6051f0e205a..75a82568249 100644 --- a/src/modules/rlm_ldap/user.c +++ b/src/modules/rlm_ldap/user.c @@ -50,7 +50,7 @@ * @param[out] rcode The status of the operation, one of the RLM_MODULE_* codes. * @return The user's DN or NULL on error. */ -char const *rlm_ldap_find_user(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t **pconn, +char const *rlm_ldap_find_user(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t **pconn, char const *attrs[], bool force, LDAPMessage **result, rlm_rcode_t *rcode) { static char const *tmp_attrs[] = { NULL }; @@ -226,7 +226,7 @@ finish: * - #RLM_MODULE_OK otherwise. */ rlm_rcode_t rlm_ldap_check_access(rlm_ldap_t const *inst, REQUEST *request, - ldap_handle_t const *conn, LDAPMessage *entry) + fr_ldap_conn_t const *conn, LDAPMessage *entry) { rlm_rcode_t rcode = RLM_MODULE_OK; struct berval **values = NULL; @@ -261,7 +261,7 @@ rlm_rcode_t rlm_ldap_check_access(rlm_ldap_t const *inst, REQUEST *request, * @param request Current request. * @param conn the connection handle */ -void rlm_ldap_check_reply(rlm_ldap_t const *inst, REQUEST *request, ldap_handle_t const *conn) +void rlm_ldap_check_reply(rlm_ldap_t const *inst, REQUEST *request, fr_ldap_conn_t const *conn) { /* * More warning messages for people who can't be bothered to read the documentation.