From 40831ba54f39cfaa205c1e1620c1d36a9f75a8d7 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 18 Nov 2010 11:33:47 +0000 Subject: [PATCH] do not add hasSubordinates if already present (fixes ITS#6712 for back-bdb/hdb, other backends may need work) --- servers/slapd/back-bdb/operational.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/servers/slapd/back-bdb/operational.c b/servers/slapd/back-bdb/operational.c index 36a0ed3973..3b5dc3a4c2 100644 --- a/servers/slapd/back-bdb/operational.c +++ b/servers/slapd/back-bdb/operational.c @@ -124,11 +124,16 @@ bdb_operational( assert( rs->sr_entry != NULL ); - for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) - /* just count */ ; + for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) { + 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