#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,
goto return_results;
}
- /* deref the base if needed */
- suffix_alias( be, &nbase );
-
#ifdef LDAP_SLAPI
attrs = anlist2charray( an );
pb = initSearchPlugin( be, conn, op, &pbase,
#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;
}