]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
LDAP query should be removed from outstanding list in demux
authorNick Porter <nick@portercomputing.co.uk>
Mon, 24 Apr 2023 17:15:28 +0000 (18:15 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 28 Apr 2023 15:22:24 +0000 (16:22 +0100)
We have received a reply, so it is no longer outstanding.

Also libldap can reuse msgid values so there could be a conflict between
a query whose reply has been received and a new query.

src/lib/ldap/base.c
src/lib/ldap/connection.c
src/lib/ldap/referral.c

index 5b0c420bf796b7c7c2290b03ffb361ca1ae9658c..37beb0b4d43fb11ada3de0475e19b8176d9f63fd 100644 (file)
@@ -920,11 +920,6 @@ static int _ldap_query_free(fr_ldap_query_t *query)
 {
        int     i;
 
-       /*
-        *      Remove the query from the tree of outstanding queries
-        */
-       if (query->ldap_conn) fr_rb_remove(query->ldap_conn->queries, query);
-
        /*
         *      Free any results which were retrieved
         */
index 90b8d27a050fe9de1a3eedf149e2f6869e9d43d7..671e1dffd9d8ea0f7e0ca0f6da7c2ea63a162677 100644 (file)
@@ -792,6 +792,11 @@ static void ldap_trunk_request_demux(fr_event_list_t *el, fr_trunk_connection_t
                        continue;
                }
 
+               /*
+                *      Remove the query from the tree of outstanding queries
+                */
+               fr_rb_remove(ldap_conn->queries, query);
+
                /*
                 *      This really shouldn't happen - as we only retrieve complete sets of results -
                 *      but as the query data structure will last until its results are fully handled
index 8b9fe803ef0cd3f7bbddd744ab02791d62a0c8cc..2ce2817e14b4fd8aa77ae45f69cc78f1bf6cb3f8 100644 (file)
@@ -115,12 +115,6 @@ int fr_ldap_referral_follow(fr_ldap_thread_t *t, request_t *request, fr_ldap_que
        int                     referral_no = -1;
        fr_ldap_referral_t      *referral;
 
-       /*
-        *      In following a referral, firstly remove the query from the
-        *      tree of pending queries clear the message id.
-        */
-       fr_rb_remove(query->ldap_conn->queries, query);
-       query->msgid = 0;
        fr_trunk_request_signal_complete(query->treq);
        query->treq = NULL;