]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/operational.c
use slab memory for proxyauthz
[openldap] / servers / slapd / back-ldbm / operational.c
index 05f382de4036843a22fb015d71de2f624763ceb1..384437cbf836a1dfd3871095d06b6de964727e7e 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -51,24 +51,27 @@ ldbm_back_hasSubordinates(
 int
 ldbm_back_operational(
        Operation       *op,
-       SlapReply       *rs,
-       int             opattrs,
-       Attribute       **a )
+       SlapReply       *rs )
 {
-       Attribute       **aa = a;
+       Attribute       **ap;
 
-       assert( rs->sr_entry );
+       assert( rs->sr_entry != NULL );
 
-       if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) ) {
+       for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
+               /* just count */ ;
+
+       if ( SLAP_OPATTRS( rs->sr_attr_flags ) ||
+                       ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) )
+       {
                int     hs;
 
                hs = has_children( op->o_bd, rs->sr_entry );
-               *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;
 }