]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/operational.c
Add a default case with assert() just in case.
[openldap] / servers / slapd / back-ldbm / operational.c
index 81fe0efb1edbda15c953eb45a54091227bc7e2c7..51c0fb710f7e85a47a26a9d8bbbabfe16807a017 100644 (file)
@@ -1,6 +1,6 @@
 /* operational.c - ldbm backend operational attributes function */
 /*
- * Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -25,7 +25,7 @@ ldbm_back_operational(
        Connection      *conn, 
        Operation       *op,
        Entry           *e,
-       char            **attrs,
+       AttributeName           *attrs,
        int             opattrs,
        Attribute       **a )
 {
@@ -37,16 +37,10 @@ ldbm_back_operational(
                int     hs;
 
                hs = has_children( be, e );
-
-               *aa = ch_malloc( sizeof( Attribute ) );
-               (*aa)->a_desc = slap_schema.si_ad_hasSubordinates;
-
-               (*aa)->a_vals = ch_malloc( 2 * sizeof( struct berval * ) );
-               (*aa)->a_vals[0] = ber_bvstrdup( hs ? "TRUE" : "FALSE" );
-               (*aa)->a_vals[1] = NULL;
-
-               (*aa)->a_next = NULL;
-               aa = &(*aa)->a_next;
+               *aa = slap_operational_hasSubordinate( hs );
+               if ( *aa != NULL ) {
+                       aa = &(*aa)->a_next;
+               }
        }
        
        return 0;