1 /* operational.c - bdb backend operational attributes function */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2000-2003 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
21 #include <ac/string.h>
22 #include <ac/socket.h>
29 * sets *hasSubordinates to LDAP_COMPARE_TRUE/LDAP_COMPARE_FALSE
30 * if the entry has children or not.
36 int *hasSubordinates )
43 rc = bdb_cache_children( op, NULL, e );
46 case DB_LOCK_DEADLOCK:
47 case DB_LOCK_NOTGRANTED:
48 ldap_pvt_thread_yield();
52 *hasSubordinates = LDAP_COMPARE_TRUE;
56 *hasSubordinates = LDAP_COMPARE_FALSE;
62 LDAP_LOG ( OPERATION, ERR,
63 "=> bdb_hasSubordinates: has_children failed: %s (%d)\n",
64 db_strerror(rc), rc, 0 );
66 Debug(LDAP_DEBUG_ARGS,
67 "<=- bdb_hasSubordinates: has_children failed: %s (%d)\n",
68 db_strerror(rc), rc, 0 );
77 * sets the supported operational attributes (if required)
88 assert( rs->sr_entry );
90 if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) ) {
93 rs->sr_err = bdb_hasSubordinates( op, rs->sr_entry, &hasSubordinates );
94 if ( rs->sr_err == LDAP_SUCCESS ) {
95 *aa = slap_operational_hasSubordinate( hasSubordinates == LDAP_COMPARE_TRUE );