]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
Added proposed request parameters to Operation. #ifdef'd, not active.
[openldap] / servers / slapd / search.c
index b679e1270e5bcf255f0a99fb92311659a8a041f4..fd7ea25a024b3c9f55137add6170074dec872b2f 100644 (file)
@@ -25,9 +25,9 @@
 #include "ldap_pvt.h"
 #include "lutil.h"
 #include "slap.h"
-#include "slapi.h"
 
 #ifdef LDAP_SLAPI
+#include "slapi.h"
 static char **anlist2charray( AttributeName *an );
 static Slapi_PBlock *initSearchPlugin( Backend *be, Connection *conn, Operation *op,
        struct berval *base, int scope, int deref, int sizelimit, int timelimit,
@@ -382,9 +382,6 @@ do_search(
                goto return_results;
        }
 
-       /* deref the base if needed */
-       suffix_alias( be, &nbase );
-
 #ifdef LDAP_SLAPI
        attrs = anlist2charray( an );
        pb = initSearchPlugin( be, conn, op, &pbase,
@@ -415,20 +412,28 @@ do_search(
 #endif /* LDAP_SLAPI */
 
 return_results:;
+
 #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 ( ( op->o_clientupdate_type & SLAP_LCUP_PERSIST ) )
+               return rc;
+#endif
+#if defined(LDAP_CLIENT_UPDATE) && defined(LDAP_SYNC)
+       else
+#endif
+#ifdef LDAP_SYNC
+       if ( ( op->o_sync_mode & SLAP_SYNC_PERSIST ) )
+               return rc;
+#endif
 
-               if( fstr.bv_val != NULL) free( fstr.bv_val );
-               if( filter != NULL) filter_free( filter );
-               if( an != NULL ) free( an );
+       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 );
 #ifdef LDAP_SLAPI
-               if( attrs != NULL) ch_free( attrs );
+       if( attrs != NULL) ch_free( attrs );
 #endif /* LDAP_SLAPI */
-       }
 
        return rc;
 }