]> 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 bc68116c281c2e2a726ea26492546fdf5aa47cfc..384437cbf836a1dfd3871095d06b6de964727e7e 100644 (file)
@@ -1,7 +1,17 @@
 /* operational.c - ldbm 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 <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2006 The OpenLDAP Foundation.
+ * 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 the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #include "portable.h"
  */
 int
 ldbm_back_hasSubordinates(
-       BackendDB       *be,
-       Connection      *conn, 
        Operation       *op,
        Entry           *e,
        int             *hasSubordinates )
 {
-       if ( has_children( be, e ) ) {
+       if ( has_children( op->o_bd, e ) ) {
                *hasSubordinates = LDAP_COMPARE_TRUE;
 
        } else {
@@ -42,28 +50,28 @@ ldbm_back_hasSubordinates(
  */
 int
 ldbm_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;
 
-               hs = has_children( be, e );
-               *aa = slap_operational_hasSubordinate( hs );
-               if ( *aa != NULL ) {
-                       aa = &(*aa)->a_next;
-               }
+               hs = has_children( op->o_bd, rs->sr_entry );
+               *ap = slap_operational_hasSubordinate( hs );
+               assert( *ap != NULL );
+
+               ap = &(*ap)->a_next;
        }
-       
+
        return 0;
 }