From: Pierangelo Masarati Date: Thu, 18 Nov 2010 11:46:18 +0000 (+0000) Subject: do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-ndb) X-Git-Tag: MIGRATION_CVS2GIT~424 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=41858b70470538ea6f2058e3e4985d38d8675e31;p=openldap do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-ndb) --- diff --git a/servers/slapd/back-ndb/search.cpp b/servers/slapd/back-ndb/search.cpp index bf2c100e1f..f799038de7 100644 --- a/servers/slapd/back-ndb/search.cpp +++ b/servers/slapd/back-ndb/search.cpp @@ -827,10 +827,15 @@ ndb_operational( assert( rs->sr_entry != NULL ); for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) - /* just count */ ; + if ( (*ap)->a_desc == slap_schema.si_ad_hasSubordinates ) { + break; + } + } - if ( SLAP_OPATTRS( rs->sr_attr_flags ) || - ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) ) + if ( *ap == NULL && + attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_hasSubordinates ) == NULL && + ( SLAP_OPATTRS( rs->sr_attr_flags ) || + ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) ) ) { int hasSubordinates, rc;