From: Quanah Gibson-Mount Date: Mon, 3 Jan 2011 23:35:20 +0000 (+0000) Subject: ITS#6712 X-Git-Tag: OPENLDAP_REL_ENG_2_4_24~188 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7cfceb214f5c3c5058ab50437d43cb0bd92cd1ce;p=openldap ITS#6712 --- diff --git a/CHANGES b/CHANGES index 55277649b8..d5332c9f5c 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,7 @@ OpenLDAP 2.4.24 Engineering Fixed slapd modify to return actual error (ITS#6581) Fixed slapd sortvals of attributes with 1 value (ITS#6715) Fixed slapd syncrepl reuse of presence list (ITS#6707) + Fixed slapd-bdb hasSubordinates generation (ITS#6712) Fixed slapd-bdb entry cache delete failure (ITS#6577) Fixed slapd-bdb error propogation to overlays (ITS#6633) Fixed slapd-ldap debug output of timeout (ITS#6721) @@ -34,11 +35,14 @@ OpenLDAP 2.4.24 Engineering Fixed slapd-ldap chaining with ppolicy (ITS#6540) Fixed slapd-ldap with SASL/EXTERNAL (ITS#6642) Fixed slapd-ndb to honor rootpw setting (ITS#6661) + Fixed slapd-ndb hasSubordinates generation (ITS#6712) Fixed slapd-meta anon retry with failed auth method (ITS#6643) Fixed slapd-meta rebind proc (ITS#6665) Fixed slapd-meta to correctly rebind as user (ITS#6574) Fixed slapd-meta with SASL/EXTERNAL (ITS#6642) + Fixed slapd-monitor hasSubordinates generation (ITS#6712) Fixed slapd-sql with null objectClass (ITS#6616) + Fixed slapd-sql hasSubordinates generation (ITS#6712) Fixed slapo-pcache callback freeing (ITS#6640) Fixed slapo-pcache to ignore undefined attrs (ITS#6600) Fixed slapo-ppolicy don't update opattrs on consumers (ITS#6608) 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; 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; diff --git a/servers/slapd/back-ndb/search.cpp b/servers/slapd/back-ndb/search.cpp index bf2c100e1f..90e49b9823 100644 --- a/servers/slapd/back-ndb/search.cpp +++ b/servers/slapd/back-ndb/search.cpp @@ -826,11 +826,16 @@ ndb_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; diff --git a/servers/slapd/back-sql/operational.c b/servers/slapd/back-sql/operational.c index eee3aea706..5057d5173e 100644 --- a/servers/slapd/back-sql/operational.c +++ b/servers/slapd/back-sql/operational.c @@ -123,7 +123,7 @@ backsql_operational( Debug( LDAP_DEBUG_TRACE, "==>backsql_operational(): entry \"%s\"\n", rs->sr_entry->e_nname.bv_val, 0, 0 ); - for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) { + for ( ap = &rs->sr_entry->e_attrs; *ap; ap = &(*ap)->a_next ) { if ( (*ap)->a_desc == slap_schema.si_ad_hasSubordinates ) { get_conn--; got[ BACKSQL_OP_HASSUBORDINATES ] = 1; @@ -138,6 +138,27 @@ backsql_operational( } } + for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) { + if ( !got[ BACKSQL_OP_HASSUBORDINATES ] && + (*ap)->a_desc == slap_schema.si_ad_hasSubordinates ) + { + get_conn--; + got[ BACKSQL_OP_HASSUBORDINATES ] = 1; + + } else if ( !got[ BACKSQL_OP_ENTRYUUID ] && + (*ap)->a_desc == slap_schema.si_ad_entryUUID ) + { + get_conn--; + got[ BACKSQL_OP_ENTRYUUID ] = 1; + + } else if ( !got[ BACKSQL_OP_ENTRYCSN ] && + (*ap)->a_desc == slap_schema.si_ad_entryCSN ) + { + get_conn--; + got[ BACKSQL_OP_ENTRYCSN ] = 1; + } + } + if ( !get_conn ) { return 0; }