From: Pierangelo Masarati Date: Thu, 18 Nov 2010 11:33:47 +0000 (+0000) Subject: do not add hasSubordinates if already present (fixes ITS#6712 for back-bdb/hdb, other... X-Git-Tag: MIGRATION_CVS2GIT~425 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=40831ba54f39cfaa205c1e1620c1d36a9f75a8d7;p=openldap do not add hasSubordinates if already present (fixes ITS#6712 for back-bdb/hdb, other backends may need work) --- 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;