/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2001-2004 The OpenLDAP Foundation.
+ * Copyright 2001-2011 The OpenLDAP Foundation.
* Portions Copyright 2001-2003 Pierangelo Masarati.
* All rights reserved.
*
{
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 ( rs->sr_opattrs == SLAP_OPATTRS ||
- 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;
- struct monitorentrypriv *mp;
+ monitor_entry_t *mp;
- mp = ( struct monitorentrypriv * )rs->sr_entry->e_private;
+ 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;
}