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"
19 * sets *hasSubordinates to LDAP_COMPARE_TRUE/LDAP_COMPARE_FALSE
20 * if the entry has children or not.
28 int *hasSubordinates )
33 assert( hasSubordinates );
36 rc = bdb_dn2id_children( be, NULL, &e->e_nname, 0 );
39 case DB_LOCK_DEADLOCK:
40 case DB_LOCK_NOTGRANTED:
41 ldap_pvt_thread_yield();
45 *hasSubordinates = LDAP_COMPARE_TRUE;
49 *hasSubordinates = LDAP_COMPARE_FALSE;
55 LDAP_LOG ( OPERATION, ERR,
56 "=> bdb_hasSubordinates: has_children failed: %s (%d)\n",
57 db_strerror(rc), rc, 0 );
59 Debug(LDAP_DEBUG_ARGS,
60 "<=- bdb_hasSubordinates: has_children failed: %s (%d)\n",
61 db_strerror(rc), rc, 0 );
70 * sets the supported operational attributes (if required)
87 if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) {
90 rc = bdb_hasSubordinates( be, conn, op, e, &hasSubordinates );
91 if ( rc == LDAP_SUCCESS ) {
92 *aa = slap_operational_hasSubordinate( hasSubordinates == LDAP_COMPARE_TRUE );