mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-19 13:23:44 -05:00
allow to glue local databases under dnssrv
This commit is contained in:
parent
96854698cd
commit
77da5c56a4
3 changed files with 38 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ dnssrv_back_db_config(
|
|||
int argc,
|
||||
char **argv )
|
||||
{
|
||||
#if 0
|
||||
struct ldapinfo *li = (struct ldapinfo *) be->be_private;
|
||||
|
||||
if ( li == NULL ) {
|
||||
|
|
@ -44,6 +45,7 @@ dnssrv_back_db_config(
|
|||
fname, lineno );
|
||||
return( 1 );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* no configuration options (yet) */
|
||||
return SLAP_CONF_UNKNOWN;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,18 @@ dnssrv_back_referrals(
|
|||
char **hosts = NULL;
|
||||
BerVarray urls = NULL;
|
||||
|
||||
if( op->o_req_dn.bv_len == 0 ) {
|
||||
if ( BER_BVISEMPTY( &op->o_req_dn ) ) {
|
||||
#ifdef LDAP_DEVEL
|
||||
#if 0
|
||||
/* FIXME: need some means to determine whether the database
|
||||
* is a glue instance */
|
||||
if ( SLAP_GLUE_INSTANCE( op->o_bd ) ) {
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
return LDAP_SUCCESS;
|
||||
#endif /* LDAP_DEVEL */
|
||||
|
||||
rs->sr_text = "DNS SRV operation upon null (empty) DN disallowed";
|
||||
return LDAP_UNWILLING_TO_PERFORM;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,6 +193,28 @@ glue_op_func ( Operation *op, SlapReply *rs )
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
glue_chk_referrals ( Operation *op, SlapReply *rs )
|
||||
{
|
||||
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
|
||||
glueinfo *gi = (glueinfo *)on->on_bi.bi_private;
|
||||
BackendDB *b0 = op->o_bd;
|
||||
BackendInfo *bi0 = op->o_bd->bd_info;
|
||||
int rc;
|
||||
|
||||
op->o_bd = glue_back_select (b0, &op->o_req_ndn);
|
||||
b0->bd_info = on->on_info->oi_orig;
|
||||
|
||||
if ( op->o_bd->bd_info->bi_chk_referrals )
|
||||
rc = ( *op->o_bd->bd_info->bi_chk_referrals )( op, rs );
|
||||
else
|
||||
rc = SLAP_CB_CONTINUE;
|
||||
|
||||
op->o_bd = b0;
|
||||
op->o_bd->bd_info = bi0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
glue_op_search ( Operation *op, SlapReply *rs )
|
||||
{
|
||||
|
|
@ -767,6 +789,8 @@ glue_init()
|
|||
glue.on_bi.bi_op_add = glue_op_func;
|
||||
glue.on_bi.bi_op_delete = glue_op_func;
|
||||
|
||||
glue.on_bi.bi_chk_referrals = glue_chk_referrals;
|
||||
|
||||
return overlay_register( &glue );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue