]> git.sur5r.net Git - openldap/commitdiff
Pass normalized DN to select_backend()
authorLuke Howard <lukeh@openldap.org>
Thu, 23 Jan 2003 14:25:13 +0000 (14:25 +0000)
committerLuke Howard <lukeh@openldap.org>
Thu, 23 Jan 2003 14:25:13 +0000 (14:25 +0000)
servers/slapd/slapi/slapi_ops.c

index aff7521afa00f9bb3f08934f7c86333169968ec3..3f1da60e6c3b96319615ca44e6747f06b170efc4 100644 (file)
@@ -49,7 +49,7 @@ internal_search_entry(
        \r
        ent2str = slapi_entry2str( e, &len );\r
        if ( ent2str == NULL ) {\r
-               return SLAPD_NO_MEMORY;\r
+               return 1;\r
        }\r
 \r
        slapi_pblock_get( (Slapi_PBlock *)op->o_pb,\r
@@ -61,23 +61,23 @@ internal_search_entry(
        if ( nentries == 0 ) {\r
                tp = (Slapi_Entry **)slapi_ch_malloc( 2 * sizeof(Slapi_Entry *) );\r
                if ( tp == NULL ) {\r
-                       return SLAPD_NO_MEMORY;\r
+                       return 1;\r
                }\r
 \r
                tp[ 0 ] = (Slapi_Entry *)str2entry( ent2str );\r
                if ( tp[ 0 ] == NULL ) { \r
-                       return SLAPD_NO_MEMORY;\r
+                       return 1;\r
                }\r
 \r
        } else {\r
                tp = (Slapi_Entry **)slapi_ch_realloc( (char *)head,\r
                                sizeof(Slapi_Entry *) * ( i + 1 ) );\r
                if ( tp == NULL ) {\r
-                       return SLAPD_NO_MEMORY;\r
+                       return 1;\r
                }\r
                tp[ i - 1 ] = (Slapi_Entry *)str2entry( ent2str );\r
                if ( tp[ i - 1 ] == NULL ) { \r
-                       return SLAPD_NO_MEMORY;\r
+                       return 1;\r
                }\r
        }\r
        tp[ i ] = NULL;\r
@@ -86,7 +86,6 @@ internal_search_entry(
                        SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, (void *)tp );\r
        slapi_pblock_set( (Slapi_PBlock *)op->o_pb,\r
                        SLAPI_NENTRIES, (void *)i );\r
-       slapi_ch_free( (void **)&ent2str );\r
 \r
        return LDAP_SUCCESS;\r
 }\r
@@ -174,6 +173,13 @@ fakeConnection(
        c->c_pending_ops.stqh_first->o_authmech.bv_val = NULL; \r
        c->c_pending_ops.stqh_first->o_authmech.bv_len = 0; \r
        c->c_pending_ops.stqh_first->o_time = slap_get_time();\r
+       c->c_pending_ops.stqh_first->o_do_not_cache = 1;\r
+\r
+       /*\r
+        * XXX this needs to be set otherwise back-bdb goes\r
+        * into an infinite loop.\r
+        */\r
+       c->c_pending_ops.stqh_first->o_threadctx = NULL;\r
 \r
        /* connection object */\r
        c->c_authmech.bv_val = NULL;\r
@@ -1203,7 +1209,7 @@ slapi_search_internal_bind(
                manageDsaIt = 1;\r
        }\r
 \r
-       be = select_backend( &dn, manageDsaIt, 0 );\r
+       be = select_backend( &ndn, manageDsaIt, 0 );\r
        if ( be == NULL ) {\r
                if ( manageDsaIt == 1 ) {\r
                        rc = LDAP_NO_SUCH_OBJECT;\r