[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#3475) send_ldap_result() called too many times in case of referrals



ando@sys-net.it wrote:

>Full_Name: Pierangelo Masarati
>Version: HEAD
>OS: irrelevant
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (81.72.89.40)
>Submitted by: ando
>
>
>The problem occurs when modifying an entry that is subordinate to a referral
>entry, but I suspect that it occurs whenever such an entry is accessed, since
>it's related to the use of backend_check_referrals().
>
>In bdb_referrals():107 in case a referral is found send_ldap_result() is
>invoked.  bdb_referrals() however, returns 80 (LDAP_OTHER), so
>backend_check_referrals():1137 calls send_ldap_result() again with rs->sr_err
>set to 80.  The latter doesn't make it to the client, fortunately, but at least
>it pollutes the server logs, and might do more harm (e.g. the chain overlay
>response function is called twice ...)
>  
>
Suggested fix:

diff -u -r1.37 referral.c
--- back-bdb/referral.c 1 Jan 2005 19:49:53 -0000       1.37
+++ back-bdb/referral.c 10 Jan 2005 23:02:50 -0000
@@ -103,7 +103,7 @@
 
                if( rs->sr_ref != NULL ) {
                        /* send referrals */
-                       rs->sr_err = LDAP_REFERRAL;
+                       rc = rs->sr_err = LDAP_REFERRAL;
                        send_ldap_result( op, rs );
                        ber_bvarray_free( rs->sr_ref );
                        rs->sr_ref = NULL;




    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497