From: Pierangelo Masarati Date: Thu, 18 Nov 2010 11:53:59 +0000 (+0000) Subject: do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-monitor) X-Git-Tag: MIGRATION_CVS2GIT~422 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=67f21784fddc61245b695bac18741540c0c66afb;p=openldap do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-monitor) --- diff --git a/servers/slapd/back-monitor/operational.c b/servers/slapd/back-monitor/operational.c index a5e68beaf7..b0d0f92f55 100644 --- a/servers/slapd/back-monitor/operational.c +++ b/servers/slapd/back-monitor/operational.c @@ -43,11 +43,16 @@ monitor_back_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 hs; monitor_entry_t *mp;