X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-monitor%2Foperational.c;h=0bccf899467e6f8c8bc94c454ac9984bb8fe7d8f;hb=d9edc7d5afd2860fac2fa0121044db28d94c9f7f;hp=2437b5f23009201ed216b3ba287859472fd23fcb;hpb=dc0eacd40b625258355eea866d62188e5aa7ce3b;p=openldap diff --git a/servers/slapd/back-monitor/operational.c b/servers/slapd/back-monitor/operational.c index 2437b5f230..0bccf89946 100644 --- a/servers/slapd/back-monitor/operational.c +++ b/servers/slapd/back-monitor/operational.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2001-2005 The OpenLDAP Foundation. + * Copyright 2001-2011 The OpenLDAP Foundation. * Portions Copyright 2001-2003 Pierangelo Masarati. * All rights reserved. * @@ -41,27 +41,32 @@ monitor_back_operational( { Attribute **ap; - assert( rs->sr_entry ); + 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; mp = ( monitor_entry_t * )rs->sr_entry->e_private; - assert( mp ); + assert( mp != NULL ); hs = MONITOR_HAS_CHILDREN( mp ); *ap = slap_operational_hasSubordinate( hs ); - assert( *ap ); + assert( *ap != NULL ); ap = &(*ap)->a_next; } - return 0; + return LDAP_SUCCESS; }