mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-23 14:09:39 +08:00
now works
This commit is contained in:
parent
ff89b2c14c
commit
4f9b916b61
@ -190,54 +190,20 @@ int backend_add(BackendInfo *aBackendInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/* startup a specific backend database */
|
||||
int backend_startup_one(Backend *be)
|
||||
static int
|
||||
backend_set_controls( BackendDB *be )
|
||||
{
|
||||
int rc = 0;
|
||||
BackendInfo *bi = be->bd_info;
|
||||
|
||||
assert(be);
|
||||
|
||||
be->be_pending_csn_list = (struct be_pcl *)
|
||||
ch_calloc( 1, sizeof( struct be_pcl ));
|
||||
|
||||
LDAP_TAILQ_INIT( be->be_pending_csn_list );
|
||||
|
||||
/* back-relay takes care of itself; so may do other */
|
||||
if ( be->be_ctrls[ SLAP_MAX_CIDS ] == 0 ) {
|
||||
if ( overlay_is_over( be ) ) {
|
||||
bi = ((slap_overinfo *)be->bd_info->bi_private)->oi_orig;
|
||||
}
|
||||
|
||||
if ( bi->bi_controls ) {
|
||||
AC_MEMCPY( be->be_ctrls, bi->bi_ctrls, sizeof( be->be_ctrls ) );
|
||||
}
|
||||
|
||||
be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
"backend_startup_one: starting \"%s\"\n",
|
||||
be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)",
|
||||
0, 0 );
|
||||
if ( be->bd_info->bi_db_open ) {
|
||||
rc = be->bd_info->bi_db_open( be );
|
||||
if ( rc != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"backend_startup_one: bi_db_open failed! (%d)\n",
|
||||
rc, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
/* back-relay takes care of itself; so may do other */
|
||||
bi = be->bd_info;
|
||||
if ( overlay_is_over( be ) ) {
|
||||
bi = ((slap_overinfo *)be->bd_info->bi_private)->oi_orig;
|
||||
}
|
||||
|
||||
if ( bi->bi_controls ) {
|
||||
if ( be->be_ctrls[ SLAP_MAX_CIDS ] == 0 ) {
|
||||
AC_MEMCPY( be->be_ctrls, bi->bi_ctrls, sizeof( be->be_ctrls ) );
|
||||
AC_MEMCPY( be->be_ctrls, bi->bi_ctrls,
|
||||
sizeof( be->be_ctrls ) );
|
||||
be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
|
||||
|
||||
} else {
|
||||
@ -245,12 +211,43 @@ int backend_startup_one(Backend *be)
|
||||
|
||||
for ( i = 0; i < SLAP_MAX_CIDS; i++ ) {
|
||||
if ( bi->bi_ctrls[ i ] ) {
|
||||
be->be_ctrls[ i ] = 1;
|
||||
be->be_ctrls[ i ] = bi->bi_ctrls[ i ];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* startup a specific backend database */
|
||||
int backend_startup_one(Backend *be)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
be->be_pending_csn_list = (struct be_pcl *)
|
||||
ch_calloc( 1, sizeof( struct be_pcl ));
|
||||
|
||||
LDAP_TAILQ_INIT( be->be_pending_csn_list );
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
"backend_startup_one: starting \"%s\"\n",
|
||||
be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)",
|
||||
0, 0 );
|
||||
(void)backend_set_controls( be );
|
||||
if ( be->bd_info->bi_db_open ) {
|
||||
rc = be->bd_info->bi_db_open( be );
|
||||
if ( rc == 0 ) {
|
||||
(void)backend_set_controls( be );
|
||||
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"backend_startup_one: bi_db_open failed! (%d)\n",
|
||||
rc, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -223,6 +223,7 @@ enum op_which {
|
||||
op_extended,
|
||||
op_aux_operational,
|
||||
op_aux_chk_referrals,
|
||||
op_aux_chk_controls,
|
||||
op_last
|
||||
};
|
||||
|
||||
@ -243,7 +244,8 @@ static int op_rc[] = {
|
||||
LDAP_UNWILLING_TO_PERFORM, /* cancel */
|
||||
LDAP_UNWILLING_TO_PERFORM, /* extended */
|
||||
LDAP_SUCCESS, /* aux_operational */
|
||||
LDAP_SUCCESS /* aux_chk_referrals */
|
||||
LDAP_SUCCESS, /* aux_chk_referrals */
|
||||
LDAP_SUCCESS /* aux_chk_controls */
|
||||
};
|
||||
|
||||
static int
|
||||
@ -377,6 +379,12 @@ over_aux_chk_referrals( Operation *op, SlapReply *rs )
|
||||
return over_op_func( op, rs, op_aux_chk_referrals );
|
||||
}
|
||||
|
||||
static int
|
||||
over_aux_chk_controls( Operation *op, SlapReply *rs )
|
||||
{
|
||||
return over_op_func( op, rs, op_aux_chk_controls );
|
||||
}
|
||||
|
||||
int
|
||||
overlay_register(
|
||||
slap_overinst *on
|
||||
@ -564,6 +572,7 @@ overlay_config( BackendDB *be, const char *ov )
|
||||
*/
|
||||
bi->bi_operational = over_aux_operational;
|
||||
bi->bi_chk_referrals = over_aux_chk_referrals;
|
||||
bi->bi_chk_controls = over_aux_chk_controls;
|
||||
|
||||
be->bd_info = bi;
|
||||
|
||||
|
@ -20,9 +20,6 @@ if test $GLUE = glueno; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Test temporarily disabled"
|
||||
exit 0
|
||||
|
||||
mkdir -p $TESTDIR $DBDIR1A $DBDIR1B $DBDIR1C
|
||||
|
||||
echo "Running slapadd to build glued slapd databases..."
|
||||
|
Loading…
Reference in New Issue
Block a user