]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
actually, get_perms is needed by ldapi:// rgeardless of -DSLAP_X_LISTENER_MOD
[openldap] / servers / slapd / search.c
index 7e36a3d7483b3b0ddf990689eca751577ac6d692..4699633403c4bc08a846577bab2b3e535aaefb2a 100644 (file)
@@ -142,14 +142,12 @@ do_search(
                        send_ldap_disconnect( conn, op,
                                LDAP_PROTOCOL_ERROR, text );
                } else {
-                       send_ldap_result( conn, op, rc,
-                               NULL, text, NULL, NULL );
+                       send_ldap_result( conn, op, rc, 
+                                       NULL, text, NULL, NULL );
                }
                goto return_results;
-
-       } else {
-               filter2bv( filter, &fstr );
        }
+       filter2bv( filter, &fstr );
 
 #ifdef NEW_LOGGING
        LDAP_LOG( OPERATION, ARGS, 
@@ -236,10 +234,8 @@ do_search(
                        }
 
                        rc = root_dse_info( conn, &entry, &text );
-               }
 
-#if defined( SLAPD_SCHEMA_DN )
-               else if ( strcasecmp( nbase.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
+               } else if ( bvmatch( &nbase, &global_schemandn ) ) {
                        /* check restrictions */
                        rc = backend_check_restrictions( NULL, conn, op, NULL, &text ) ;
                        if( rc != LDAP_SUCCESS ) {
@@ -250,7 +246,6 @@ do_search(
 
                        rc = schema_info( &entry, &text );
                }
-#endif
 
                if( rc != LDAP_SUCCESS ) {
                        send_ldap_result( conn, op, rc,
@@ -319,7 +314,7 @@ do_search(
        if ( be->be_search ) {
                (*be->be_search)( be, conn, op, &pbase, &nbase,
                        scope, deref, sizelimit,
-                   timelimit, filter, &fstr, an, attrsonly );
+                       timelimit, filter, &fstr, an, attrsonly );
        } else {
                send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
                        NULL, "operation not supported within namingContext",
@@ -327,12 +322,17 @@ do_search(
        }
 
 return_results:;
-       if( pbase.bv_val != NULL) free( pbase.bv_val );
-       if( nbase.bv_val != NULL) free( nbase.bv_val );
+#ifdef LDAP_CLIENT_UPDATE
+       if ( !( op->o_clientupdate_type & SLAP_LCUP_PERSIST ) )
+#endif /* LDAP_CLIENT_UPDATE */
+       {
+               if( pbase.bv_val != NULL) free( pbase.bv_val );
+               if( nbase.bv_val != NULL) free( nbase.bv_val );
 
-       if( fstr.bv_val != NULL) free( fstr.bv_val );
-       if( filter != NULL) filter_free( filter );
-       if( an != NULL ) free( an );
+               if( fstr.bv_val != NULL) free( fstr.bv_val );
+               if( filter != NULL) filter_free( filter );
+               if( an != NULL ) free( an );
+       }
 
        return rc;
 }