X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-monitor%2Foperational.c;h=bf0b964f5b123d5b0fe148198e5aa47bb37f8669;hb=5ceb2cd4e0f4e766be0bc10211a734b7791f3a32;hp=0141d17451134cc43899a027db35002cef2d66fe;hpb=0e2af54a3ffdeebe3901370683be56fcc53023b0;p=openldap diff --git a/servers/slapd/back-monitor/operational.c b/servers/slapd/back-monitor/operational.c index 0141d17451..bf0b964f5b 100644 --- a/servers/slapd/back-monitor/operational.c +++ b/servers/slapd/back-monitor/operational.c @@ -1,7 +1,22 @@ /* operational.c - monitor backend operational attributes function */ -/* - * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 2001-2009 The OpenLDAP Foundation. + * Portions Copyright 2001-2003 Pierangelo Masarati. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* ACKNOWLEDGEMENTS: + * This work was initially developed by Pierangelo Masarati for inclusion + * in OpenLDAP Software. */ #include "portable.h" @@ -21,33 +36,32 @@ int monitor_back_operational( - BackendDB *be, - Connection *conn, Operation *op, - Entry *e, - AttributeName *attrs, - int opattrs, - Attribute **a ) + SlapReply *rs ) { - Attribute **aa = a; + Attribute **ap; + + assert( rs->sr_entry != NULL ); - assert( e ); + for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next ) + /* just count */ ; - if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) { + if ( 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 * )e->e_private; + mp = ( monitor_entry_t * )rs->sr_entry->e_private; - assert( mp ); + assert( mp != NULL ); hs = MONITOR_HAS_CHILDREN( mp ); - *aa = slap_operational_hasSubordinate( hs ); - if ( *aa != NULL ) { - aa = &(*aa)->a_next; - } + *ap = slap_operational_hasSubordinate( hs ); + assert( *ap != NULL ); + ap = &(*ap)->a_next; } - return 0; + return LDAP_SUCCESS; }