/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2003-2007 The OpenLDAP Foundation.
+ * Copyright 2003-2009 The OpenLDAP Foundation.
* Portions Copyright 2003 Howard Chu.
* All rights reserved.
*
LDAP_CH_RES,
LDAP_CH_ERR
} ldap_chain_status_t;
+
static BackendInfo *lback;
typedef struct ldap_chain_t {
struct berval odn = op->o_req_dn,
ondn = op->o_req_ndn;
slap_response *save_response = op->o_callback->sc_response;
+ Entry *save_entry = rs->sr_entry;
+ slap_mask_t save_flags = rs->sr_flags;
int rc = LDAP_OTHER,
first_rc = -1;
ldap_memfree( li.li_uri );
li.li_uri = NULL;
- op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
- op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
-
if ( temporary ) {
lip->li_uri = NULL;
lip->li_bvuri = NULL;
op->o_req_ndn = ondn;
op->o_callback->sc_response = save_response;
rs->sr_type = REP_SEARCHREF;
- rs->sr_entry = NULL;
+ rs->sr_entry = save_entry;
+ rs->sr_flags = save_flags;
if ( rc != LDAP_SUCCESS ) {
/* couldn't chase any of the referrals */
"NAME 'olcChainDatabase' "
"DESC 'Chain remote server configuration' "
"AUXILIARY )",
- Cft_Misc, chaincfg, chain_ldadd },
+ Cft_Misc, olcDatabaseDummy, chain_ldadd },
{ NULL, 0, NULL }
};
}
}
+ ca->ca_private = on;
+
done:;
if ( rc != LDAP_SUCCESS ) {
(void)ldap_chain_db_destroy_one( ca->be, NULL );
struct berval bv;
/* FIXME: should not hardcode "olcDatabase" here */
- bv.bv_len = snprintf( lca->ca->msg, sizeof( lca->ca->msg ),
+ bv.bv_len = snprintf( lca->ca->cr_msg, sizeof( lca->ca->cr_msg ),
"olcDatabase={%d}%s", lca->count, lback->bi_type );
- bv.bv_val = lca->ca->msg;
+ bv.bv_val = lca->ca->cr_msg;
lca->ca->be->be_private = (void *)li;
config_build_entry( lca->op, lca->rs, lca->p->e_private, lca->ca,
case CH_MAX_DEPTH:
if ( c->value_int < 0 ) {
- snprintf( c->msg, sizeof( c->msg ),
+ snprintf( c->cr_msg, sizeof( c->cr_msg ),
"<%s> invalid max referral depth %d",
c->argv[0], c->value_int );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
- c->log, c->msg, 0 );
+ c->log, c->cr_msg, 0 );
rc = 1;
break;
}
static int
ldap_chain_db_init(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *)be->bd_info;
ldap_chain_t *lc = NULL;
if ( lback == NULL ) {
- static BackendInfo lback2;
-
lback = backend_info( "ldap" );
if ( lback == NULL ) {
return 1;
}
-
- lback2 = *lback;
- lback2.bi_type = ldapchain.on_bi.bi_type;
- lback = &lback2;
}
lc = ch_malloc( sizeof( ldap_chain_t ) );
static int
ldap_chain_db_open(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *) be->bd_info;
ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private;
static int
ldap_chain_db_close(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
return ldap_chain_db_func( be, db_close );
}
static int
ldap_chain_db_destroy(
BackendDB *be,
- ConfigArgs *ca )
+ ConfigReply *cr )
{
slap_overinst *on = (slap_overinst *) be->bd_info;
ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private;
int
chain_initialize( void )
{
- int rc;
+ int rc;
+ const char *text;
/* Make sure we don't exceed the bits reserved for userland */
config_check_userland( CH_LAST );