From 41858b70470538ea6f2058e3e4985d38d8675e31 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 18 Nov 2010 11:46:18 +0000 Subject: [PATCH] do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-ndb) --- servers/slapd/back-ndb/search.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; -- 2.39.5