if ( e_ch == NULL ) {
/* no persistent entries? return */
if ( e == NULL ) {
- return( 0 );
+ return LDAP_SUCCESS;
}
/* volatile entries */
mp = ( monitor_entry_t * )e->e_private;
monitor_entry_update( op, e );
+
+ if ( op->o_abandon ) {
+ monitor_cache_release( mi, e );
+ return SLAPD_ABANDON;
+ }
rc = test_filter( op, e, op->oq_search.rs_filter );
if ( rc == LDAP_COMPARE_TRUE ) {
}
if ( ( mp->mp_children || MONITOR_HAS_VOLATILE_CH( mp ) )
- && sub ) {
+ && sub )
+ {
rc = monitor_send_children( op, rs, e, sub );
if ( rc ) {
+ monitor_cache_release( mi, e );
return( rc );
}
}
e = e_tmp;
}
- return( 0 );
+ return LDAP_SUCCESS;
}
int
monitor_info_t *mi = ( monitor_info_t * )op->o_bd->be_private;
int rc = LDAP_SUCCESS;
Entry *e = NULL, *matched = NULL;
+ slap_mask_t mask;
Debug( LDAP_DEBUG_TRACE, "=> monitor_back_search\n", 0, 0, 0 );
if ( e == NULL ) {
rs->sr_err = LDAP_NO_SUCH_OBJECT;
if ( matched ) {
- rs->sr_matched = matched->e_dn;
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+ if ( !access_allowed_mask( op, matched,
+ slap_schema.si_ad_entry,
+ NULL, ACL_DISCLOSE, NULL, NULL ) )
+ {
+ /* do nothing */ ;
+ } else
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+ {
+ rs->sr_matched = matched->e_dn;
+ }
}
send_ldap_result( op, rs );
rs->sr_matched = NULL;
}
- return( 0 );
+ return rs->sr_err;
+ }
+
+ /* NOTE: __NEW__ "search" access is required
+ * on searchBase object */
+ if ( !access_allowed_mask( op, e, slap_schema.si_ad_entry,
+ NULL, ACL_SEARCH, NULL, &mask ) )
+ {
+ monitor_cache_release( mi, e );
+
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+ if ( !ACL_GRANT( mask, ACL_DISCLOSE ) ) {
+ rs->sr_err = LDAP_NO_SUCH_OBJECT;
+ } else
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+ {
+ rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
+ }
+
+ send_ldap_result( op, rs );
+
+ return rs->sr_err;
}
rs->sr_attrs = op->oq_search.rs_attrs;
case LDAP_SCOPE_ONELEVEL:
rc = monitor_send_children( op, rs, e, 0 );
- if ( rc ) {
- rc = LDAP_OTHER;
- }
-
break;
case LDAP_SCOPE_SUBTREE:
}
rc = monitor_send_children( op, rs, e, 1 );
- if ( rc ) {
- rc = LDAP_OTHER;
- }
-
break;
}
-
+
rs->sr_attrs = NULL;
rs->sr_err = rc;
- send_ldap_result( op, rs );
+ if ( rs->sr_err != SLAPD_ABANDON ) {
+ send_ldap_result( op, rs );
+ }
- return( rc == LDAP_SUCCESS ? 0 : 1 );
+ return rs->sr_err;
}