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

error text in search results



I was trying to send some descriptive text back in a search error from one
of my backends, and couldn't understand why it wasn't being shown on the
client. It turns out that the text wasn't ever being sent, due to this
little bit in slapd/result.c - if the connection protocol was older than
LDAPv3, the "text" was replaced with the "refs" stuff, regardless of whether
or not the result code was actually dealing with a referral. I've made the
following patch to my copy, is there any problem with checking this in?

+++ result.c    1999/10/21 23:14:42
@@ -443,11 +443,9 @@

        trim_refs_urls( refs );

-       if( op->o_protocol < LDAP_VERSION3 ) {
+       if( op->o_protocol < LDAP_VERSION3 && err == LDAP_REFERRAL ) {
                /* send references in search results */
-               if( err == LDAP_REFERRAL ) {
-                       err = LDAP_PARTIAL_RESULTS;
-               }
+               err = LDAP_PARTIAL_RESULTS;

                tmp = v2ref( refs );
                text = tmp;