- assert( e );
-
- if ( !opattrs && !ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) {
- return 0;
- }
-
-
- if( 0 ) {
-retry: /* transaction retry */
- if( e != NULL ) {
- bdb_cache_return_entry_w(&bdb->bi_cache, e);
+ assert( e != NULL );
+
+ /* NOTE: this should never happen, but it actually happens
+ * when using back-relay; until we find a better way to
+ * preserve entry's private information while rewriting it,
+ * let's disable the hasSubordinate feature for back-relay.
+ */
+ if ( BEI( e ) == NULL ) {
+ Entry *ee = NULL;
+ rc = be_entry_get_rw( op, &e->e_nname, NULL, NULL, 0, &ee );
+ if ( rc != LDAP_SUCCESS || ee == NULL ) {
+ rc = LDAP_OTHER;
+ goto done;