From: Pierangelo Masarati Date: Thu, 18 Nov 2010 11:51:15 +0000 (+0000) Subject: do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-sql) X-Git-Tag: MIGRATION_CVS2GIT~423 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3dcc62503a711f85d75e0ab19c77495d6d94f0bd;p=openldap do not add hasSubordinates if already present (blind-fixes ITS#6712 for back-sql) --- 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; }