From: Pierangelo Masarati Date: Fri, 28 Jan 2005 21:38:02 +0000 (+0000) Subject: allow to glue local databases under dnssrv X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~227 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=77da5c56a4f840d6d126b8ea5c122722330bd24f;p=openldap allow to glue local databases under dnssrv --- diff --git a/servers/slapd/back-dnssrv/config.c b/servers/slapd/back-dnssrv/config.c index 5ba68ff34e..bf3370fb81 100644 --- a/servers/slapd/back-dnssrv/config.c +++ b/servers/slapd/back-dnssrv/config.c @@ -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; diff --git a/servers/slapd/back-dnssrv/referral.c b/servers/slapd/back-dnssrv/referral.c index 76b3372227..2a95d94a8c 100644 --- a/servers/slapd/back-dnssrv/referral.c +++ b/servers/slapd/back-dnssrv/referral.c @@ -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; } diff --git a/servers/slapd/overlays/glue.c b/servers/slapd/overlays/glue.c index c5852e8914..1686a905c6 100644 --- a/servers/slapd/overlays/glue.c +++ b/servers/slapd/overlays/glue.c @@ -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 ); }