1 /* operational.c - bdb backend operational attributes function */
3 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/string.h>
12 #include <ac/socket.h>
16 #include "proto-bdb.h"
20 * sets *hasSubordinates to LDAP_COMPARE_TRUE/LDAP_COMPARE_FALSE
21 * if the entry has children or not.
27 int *hasSubordinates )
34 rc = bdb_dn2id_children( op, NULL, e );
37 case DB_LOCK_DEADLOCK:
38 case DB_LOCK_NOTGRANTED:
39 ldap_pvt_thread_yield();
43 *hasSubordinates = LDAP_COMPARE_TRUE;
47 *hasSubordinates = LDAP_COMPARE_FALSE;
53 LDAP_LOG ( OPERATION, ERR,
54 "=> bdb_hasSubordinates: has_children failed: %s (%d)\n",
55 db_strerror(rc), rc, 0 );
57 Debug(LDAP_DEBUG_ARGS,
58 "<=- bdb_hasSubordinates: has_children failed: %s (%d)\n",
59 db_strerror(rc), rc, 0 );
68 * sets the supported operational attributes (if required)
79 assert( rs->sr_entry );
81 if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) ) {
84 rs->sr_err = bdb_hasSubordinates( op, rs->sr_entry, &hasSubordinates );
85 if ( rs->sr_err == LDAP_SUCCESS ) {
86 *aa = slap_operational_hasSubordinate( hasSubordinates == LDAP_COMPARE_TRUE );