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>
19 * sets *hasSubordinates to LDAP_COMPARE_TRUE/LDAP_COMPARE_FALSE
20 * if the entry has children or not.
26 int *hasSubordinates )
33 rc = bdb_cache_children( op, NULL, e );
36 case DB_LOCK_DEADLOCK:
37 case DB_LOCK_NOTGRANTED:
38 ldap_pvt_thread_yield();
42 *hasSubordinates = LDAP_COMPARE_TRUE;
46 *hasSubordinates = LDAP_COMPARE_FALSE;
52 LDAP_LOG ( OPERATION, ERR,
53 "=> bdb_hasSubordinates: has_children failed: %s (%d)\n",
54 db_strerror(rc), rc, 0 );
56 Debug(LDAP_DEBUG_ARGS,
57 "<=- bdb_hasSubordinates: has_children failed: %s (%d)\n",
58 db_strerror(rc), rc, 0 );
67 * sets the supported operational attributes (if required)
78 assert( rs->sr_entry );
80 if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) ) {
83 rs->sr_err = bdb_hasSubordinates( op, rs->sr_entry, &hasSubordinates );
84 if ( rs->sr_err == LDAP_SUCCESS ) {
85 *aa = slap_operational_hasSubordinate( hasSubordinates == LDAP_COMPARE_TRUE );