version 1.65, 2007/05/15 20:29:06
|
version 1.66, 2007/07/25 15:21:05
|
Line 1
|
Line 1
|
/* chain.c - chain LDAP operations */ |
/* chain.c - chain LDAP operations */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/back-ldap/chain.c,v 1.64 2007/04/04 15:48:25 hallvard Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/back-ldap/chain.c,v 1.65 2007/05/15 20:29:06 ando Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
* Copyright 2003-2007 The OpenLDAP Foundation. |
* Copyright 2003-2007 The OpenLDAP Foundation. |
Line 112 static int ldap_chain_db_init_common( Ba
|
Line 112 static int ldap_chain_db_init_common( Ba
|
static int ldap_chain_db_init_one( BackendDB *be ); |
static int ldap_chain_db_init_one( BackendDB *be ); |
static int ldap_chain_db_open_one( BackendDB *be ); |
static int ldap_chain_db_open_one( BackendDB *be ); |
#define ldap_chain_db_close_one(be) (0) |
#define ldap_chain_db_close_one(be) (0) |
#define ldap_chain_db_destroy_one(be) (lback)->bi_db_destroy( (be) ) |
#define ldap_chain_db_destroy_one(be, rs) (lback)->bi_db_destroy( (be), (rs) ) |
|
|
typedef struct ldap_chain_cb_t { |
typedef struct ldap_chain_cb_t { |
ldap_chain_status_t lb_status; |
ldap_chain_status_t lb_status; |
Line 507 Document: RFC 4511
|
Line 507 Document: RFC 4511
|
if ( rc != 0 ) { |
if ( rc != 0 ) { |
lip->li_uri = NULL; |
lip->li_uri = NULL; |
lip->li_bvuri = NULL; |
lip->li_bvuri = NULL; |
(void)ldap_chain_db_destroy_one( op->o_bd ); |
(void)ldap_chain_db_destroy_one( op->o_bd, NULL); |
goto cleanup; |
goto cleanup; |
} |
} |
|
|
Line 546 cleanup:;
|
Line 546 cleanup:;
|
lip->li_uri = NULL; |
lip->li_uri = NULL; |
lip->li_bvuri = NULL; |
lip->li_bvuri = NULL; |
(void)ldap_chain_db_close_one( op->o_bd ); |
(void)ldap_chain_db_close_one( op->o_bd ); |
(void)ldap_chain_db_destroy_one( op->o_bd ); |
(void)ldap_chain_db_destroy_one( op->o_bd, NULL ); |
} |
} |
|
|
further_cleanup:; |
further_cleanup:; |
Line 691 ldap_chain_search(
|
Line 691 ldap_chain_search(
|
if ( rc != 0 ) { |
if ( rc != 0 ) { |
lip->li_uri = NULL; |
lip->li_uri = NULL; |
lip->li_bvuri = NULL; |
lip->li_bvuri = NULL; |
(void)ldap_chain_db_destroy_one( op->o_bd ); |
(void)ldap_chain_db_destroy_one( op->o_bd, NULL ); |
goto cleanup; |
goto cleanup; |
} |
} |
|
|
Line 733 cleanup:;
|
Line 733 cleanup:;
|
lip->li_uri = NULL; |
lip->li_uri = NULL; |
lip->li_bvuri = NULL; |
lip->li_bvuri = NULL; |
(void)ldap_chain_db_close_one( op->o_bd ); |
(void)ldap_chain_db_close_one( op->o_bd ); |
(void)ldap_chain_db_destroy_one( op->o_bd ); |
(void)ldap_chain_db_destroy_one( op->o_bd, NULL ); |
} |
} |
|
|
further_cleanup:; |
further_cleanup:; |
Line 1192 chain_ldadd( CfEntryInfo *p, Entry *e, C
|
Line 1192 chain_ldadd( CfEntryInfo *p, Entry *e, C
|
|
|
done:; |
done:; |
if ( rc != LDAP_SUCCESS ) { |
if ( rc != LDAP_SUCCESS ) { |
(void)ldap_chain_db_destroy_one( ca->be ); |
(void)ldap_chain_db_destroy_one( ca->be, NULL ); |
ch_free( ca->be ); |
ch_free( ca->be ); |
ca->be = NULL; |
ca->be = NULL; |
} |
} |
Line 1506 chain_cf_gen( ConfigArgs *c )
|
Line 1506 chain_cf_gen( ConfigArgs *c )
|
|
|
static int |
static int |
ldap_chain_db_init( |
ldap_chain_db_init( |
BackendDB *be ) |
BackendDB *be, |
|
ConfigArgs *ca ) |
{ |
{ |
slap_overinst *on = (slap_overinst *)be->bd_info; |
slap_overinst *on = (slap_overinst *)be->bd_info; |
ldap_chain_t *lc = NULL; |
ldap_chain_t *lc = NULL; |
Line 1637 private_destroy:;
|
Line 1638 private_destroy:;
|
|
|
db.bd_info = lback; |
db.bd_info = lback; |
db.be_private = (void *)lc->lc_cfg_li; |
db.be_private = (void *)lc->lc_cfg_li; |
ldap_chain_db_destroy_one( &db ); |
ldap_chain_db_destroy_one( &db, NULL ); |
lc->lc_cfg_li = NULL; |
lc->lc_cfg_li = NULL; |
|
|
} else { |
} else { |
Line 1690 ldap_chain_db_apply( void *datum, void *
|
Line 1691 ldap_chain_db_apply( void *datum, void *
|
|
|
lca->be->be_private = (void *)li; |
lca->be->be_private = (void *)li; |
|
|
return lca->func( lca->be ); |
return lca->func( lca->be, NULL ); |
} |
} |
|
|
static int |
static int |
Line 1713 ldap_chain_db_func(
|
Line 1714 ldap_chain_db_func(
|
db.bd_info = lback; |
db.bd_info = lback; |
db.be_private = lc->lc_common_li; |
db.be_private = lc->lc_common_li; |
|
|
rc = func( &db ); |
rc = func( &db, NULL ); |
|
|
if ( rc != 0 ) { |
if ( rc != 0 ) { |
return rc; |
return rc; |
Line 1737 ldap_chain_db_func(
|
Line 1738 ldap_chain_db_func(
|
|
|
static int |
static int |
ldap_chain_db_open( |
ldap_chain_db_open( |
BackendDB *be ) |
BackendDB *be, |
|
ConfigArgs *ca ) |
{ |
{ |
slap_overinst *on = (slap_overinst *) be->bd_info; |
slap_overinst *on = (slap_overinst *) be->bd_info; |
ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private; |
ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private; |
Line 1769 ldap_chain_db_open(
|
Line 1771 ldap_chain_db_open(
|
|
|
static int |
static int |
ldap_chain_db_close( |
ldap_chain_db_close( |
BackendDB *be ) |
BackendDB *be, |
|
ConfigArgs *ca ) |
{ |
{ |
return ldap_chain_db_func( be, db_close ); |
return ldap_chain_db_func( be, db_close ); |
} |
} |
|
|
static int |
static int |
ldap_chain_db_destroy( |
ldap_chain_db_destroy( |
BackendDB *be ) |
BackendDB *be, |
|
ConfigArgs *ca ) |
{ |
{ |
slap_overinst *on = (slap_overinst *) be->bd_info; |
slap_overinst *on = (slap_overinst *) be->bd_info; |
ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private; |
ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private; |
Line 1808 ldap_chain_db_init_common(
|
Line 1812 ldap_chain_db_init_common(
|
|
|
be->bd_info = lback; |
be->bd_info = lback; |
be->be_private = NULL; |
be->be_private = NULL; |
rc = lback->bi_db_init( be ); |
rc = lback->bi_db_init( be, NULL ); |
if ( rc != 0 ) { |
if ( rc != 0 ) { |
return rc; |
return rc; |
} |
} |
Line 1843 ldap_chain_db_init_one(
|
Line 1847 ldap_chain_db_init_one(
|
|
|
be->bd_info = lback; |
be->bd_info = lback; |
be->be_private = NULL; |
be->be_private = NULL; |
t = lback->bi_db_init( be ); |
t = lback->bi_db_init( be, NULL ); |
if ( t != 0 ) { |
if ( t != 0 ) { |
return t; |
return t; |
} |
} |
Line 1887 ldap_chain_db_open_one(
|
Line 1891 ldap_chain_db_open_one(
|
} |
} |
} |
} |
|
|
return lback->bi_db_open( be ); |
return lback->bi_db_open( be, NULL ); |
} |
} |
|
|
typedef struct ldap_chain_conn_apply_t { |
typedef struct ldap_chain_conn_apply_t { |