]> git.sur5r.net Git - openldap/commitdiff
do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-monitor)
authorPierangelo Masarati <ando@openldap.org>
Thu, 18 Nov 2010 11:53:59 +0000 (11:53 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 18 Nov 2010 11:53:59 +0000 (11:53 +0000)
servers/slapd/back-monitor/operational.c

index a5e68beaf7fe01cb83a4fd3622575977ab9ceccb..b0d0f92f552f4bf031b6ffcc61cf3902f4bf29d1 100644 (file)
@@ -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;