From: Arran Cudbard-Bell Date: Thu, 14 Oct 2021 15:54:26 +0000 (-0500) Subject: ldap: Only do URL parsing when we're allocing ldap queries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75252effe38418bfb372dd3f79ddb719882159c1;p=thirdparty%2Ffreeradius-server.git ldap: Only do URL parsing when we're allocing ldap queries --- diff --git a/src/lib/ldap/connection.c b/src/lib/ldap/connection.c index 54c6d975732..84a63d4a783 100644 --- a/src/lib/ldap/connection.c +++ b/src/lib/ldap/connection.c @@ -676,40 +676,6 @@ static void ldap_trunk_request_mux(UNUSED fr_event_list_t *el, fr_trunk_connecti */ if (query->referral) referral_url = query->referral->referral_url; - /* - * Queries can be from parsed URLs, if so point at the relevant - * parts of the parsed structure - */ - if (query->ldap_url) { - query->dn = query->ldap_url->lud_dn; - memcpy(&query->search.attrs, &query->ldap_url->lud_attrs, sizeof(query->search.attrs)); - query->search.scope = query->ldap_url->lud_scope; - query->search.filter = query->ldap_url->lud_filter; - - /* - * Parsing LDAP server extensions from the URL is only - * possible once we know which conneciton the query will be - * handled by as the conneciton handle is used by the parsing - * function. - */ - if (query->ldap_url->lud_exts) { - LDAPControl *serverctrls[LDAP_MAX_CONTROLS]; - int i; - - if (fr_ldap_parse_url_extensions(serverctrls, query->request, - ldap_conn, query->ldap_url->lud_exts) < 0) { - error: - fr_trunk_request_signal_fail(query->treq); - return; - } - for (i = 0; i < LDAP_MAX_CONTROLS; i++) { - if (!serverctrls[i]) break; - query->serverctrls[i].control = serverctrls[i]; - query->serverctrls[i].freeit = true; - } - } - } - POPULATE_LDAP_CONTROLS(our_serverctrls, query->serverctrls); POPULATE_LDAP_CONTROLS(our_clientctrls, query->clientctrls);