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

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