- slapi_pblock_get( op->o_pb, SLAPI_SEARCH_FILTER, (void *)&f );
- if ( f != op->ors_filter ) {
- /* Plugin modified filter. Is pointer comparison safe? */
- /*
- * This is inefficient but it is not possible to expose the
- * new memory allocation API through SLAPI.
- *
- * Further, the plugin should be responsible for freeing
- * the original filter, but there is no way to communicate
- * the memory context through the SLAPI filter free API.
- */
- op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
- filter2bv_x( op, f, &op->ors_filterstr );
- filter_free_x( op, op->ors_filter );
- op->ors_filter = str2filter_x( op, op->ors_filterstr.bv_val );
+ slapi_pblock_get( op->o_pb, SLAPI_SEARCH_FILTER, (void *)&op->ors_filter );
+ op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
+ filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
+
+ /*
+ * Also permit other search parameters to be reset. One thing
+ * this doesn't (yet) deal with is plugins that change a root
+ * DSE search to a non-root DSE search...
+ */
+ slapi_pblock_get( op->o_pb, SLAPI_SEARCH_TARGET, (void **)&op->o_req_dn.bv_val );
+ op->o_req_dn.bv_len = strlen( op->o_req_dn.bv_val );
+
+ if( op->o_req_ndn.bv_val != NULL) {
+ sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
+ }
+ rc = dnNormalize( 0, NULL, NULL, &op->o_req_dn, &op->o_req_ndn,
+ op->o_tmpmemctx );
+ if ( rc != LDAP_SUCCESS ) {
+ return rc;
+ }
+
+ slapi_pblock_get( op->o_pb, SLAPI_SEARCH_SCOPE, (void **)&op->ors_scope );
+ slapi_pblock_get( op->o_pb, SLAPI_SEARCH_DEREF, (void **)&op->ors_deref );
+