/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2010 The OpenLDAP Foundation.
+ * Copyright 1998-2011 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
}
acl_destroy( bd->be_acl );
limits_destroy( bd->be_limits );
+ if ( bd->be_extra_anlist ) {
+ anlist_free( bd->be_extra_anlist, 1, NULL );
+ }
if ( !BER_BVISNULL( &bd->be_update_ndn ) ) {
ch_free( bd->be_update_ndn.bv_val );
}
ber_bvarray_free( bd->be_update_refs );
}
+ ldap_pvt_thread_mutex_destroy( &bd->be_pcl_mutex );
+
if ( dynamic ) {
free( bd );
}
/* If we created and linked this be, remove it and free it */
if ( !b0 ) {
LDAP_STAILQ_REMOVE(&backendDB, be, BackendDB, be_next);
+ ldap_pvt_thread_mutex_destroy( &be->be_pcl_mutex );
ch_free( be );
be = NULL;
nbackends--;
requires |= op->o_bd->be_requires;
bssf = &op->o_bd->be_ssf_set.sss_ssf;
fssf = &ssfs.sss_ssf;
- for ( i=0; i<sizeof(ssfs)/sizeof(slap_ssf_t); i++ ) {
+ for ( i=0; i < (int)(sizeof(ssfs)/sizeof(slap_ssf_t)); i++ ) {
if ( bssf[i] ) fssf[i] = bssf[i];
}
}
a = attr_find( e->e_attrs, entry_at );
if ( a == NULL ) {
- SlapReply rs = { 0 };
+ SlapReply rs = { REP_SEARCH };
AttributeName anlist[ 2 ];
anlist[ 0 ].an_name = entry_at->ad_cname;
* to do no harm to entries */
rs.sr_entry = e;
rc = backend_operational( op, &rs );
- rs.sr_entry = NULL;
-
+
if ( rc == LDAP_SUCCESS ) {
if ( rs.sr_operational_attrs ) {
freeattr = 1;
slap_mask_t *mask )
{
Entry *e = NULL;
- void *o_priv = op->o_private, *e_priv = NULL;
+ void *o_priv, *e_priv = NULL;
int rc = LDAP_INSUFFICIENT_ACCESS;
- Backend *be = op->o_bd;
+ Backend *be;
/* pedantic */
assert( op != NULL );
assert( edn != NULL );
assert( access > ACL_NONE );
+ be = op->o_bd;
+ o_priv = op->o_private;
+
if ( !op->o_bd ) {
op->o_bd = select_backend( edn, 0 );
}
} else {
a = attr_find( e->e_attrs, entry_at );
if ( a == NULL ) {
- SlapReply rs = { 0 };
+ SlapReply rs = { REP_SEARCH };
AttributeName anlist[ 2 ];
anlist[ 0 ].an_name = entry_at->ad_cname;
* to do no harm to entries */
rs.sr_entry = e;
rc = backend_operational( op, &rs );
- rs.sr_entry = NULL;
if ( rc == LDAP_SUCCESS ) {
if ( rs.sr_operational_attrs ) {