mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-09 08:23:35 -05:00
honor SLAP_GLUE_INSTANCE() flag; allow to advertize subordinate databases
This commit is contained in:
parent
d503b5a5b7
commit
3b84f11d25
6 changed files with 31 additions and 21 deletions
|
|
@ -30,11 +30,13 @@ directive and before any subsequent
|
|||
.B database
|
||||
directive.
|
||||
.TP
|
||||
.B glue-sub <suffix-DN> [async]
|
||||
.B glue-sub <suffix-DN> [async] [advertize]
|
||||
Specify the suffix of a database to attach as a subordinate to the root
|
||||
database. The specified database must have already been configured. If the
|
||||
optional "async" keyword is supplied, searches against this database may
|
||||
be spawned in a separate thread to run concurrently with other operations.
|
||||
optional \fBasync\fP keyword is supplied, searches against this database may
|
||||
be spawned in a separate thread to run concurrently with other operations
|
||||
(currently not implemented). If the optional \fBadvertize\fI flag
|
||||
is supplied, the naming context is advertized in the rootDSE.
|
||||
.SH FILES
|
||||
.TP
|
||||
ETCDIR/slapd.conf
|
||||
|
|
|
|||
|
|
@ -43,14 +43,11 @@ dnssrv_back_referrals(
|
|||
|
||||
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";
|
||||
|
|
|
|||
|
|
@ -49,16 +49,14 @@ dnssrv_back_search(
|
|||
|
||||
if ( BER_BVISEMPTY( &op->o_req_ndn ) ) {
|
||||
#ifdef LDAP_DEVEL
|
||||
#if 0
|
||||
/* FIXME: need some means to determine whether the database
|
||||
* is a glue instance; if we got here with empty DN, then
|
||||
* we passed this same test in dnssrv_back_referrals() */
|
||||
if ( !SLAP_GLUE_INSTANCE( op->o_bd ) ) {
|
||||
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
|
||||
rs->sr_err = "DNS SRV operation upon null (empty) DN disallowed";
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
rs->sr_text = "DNS SRV operation upon null (empty) DN disallowed";
|
||||
|
||||
} else {
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
}
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -761,23 +761,30 @@ glue_db_config(
|
|||
slap_overinst *on = (slap_overinst *)be->bd_info;
|
||||
glueinfo *gi = (glueinfo *)on->on_bi.bi_private;
|
||||
|
||||
/* redundant; could be applied just once */
|
||||
SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_INSTANCE;
|
||||
|
||||
if ( strcasecmp( argv[0], "glue-sub" ) == 0 ) {
|
||||
int async = 0;
|
||||
int i, async = 0, advertize = 0;
|
||||
BackendDB *b2;
|
||||
struct berval bv, dn;
|
||||
gluenode *gn;
|
||||
|
||||
if ( argc < 2 ) {
|
||||
fprintf( stderr, "%s: line %d: too few arguments in "
|
||||
"\"glue-sub <suffixDN> [async]\"\n", fname, lineno );
|
||||
"\"glue-sub <suffixDN> [async] [advertize]\"\n", fname, lineno );
|
||||
return -1;
|
||||
}
|
||||
if ( argc == 3 ) {
|
||||
if ( strcasecmp( argv[2], "async" )) {
|
||||
fprintf( stderr, "%s: line %d: unrecognized option "
|
||||
"\"%s\" ignored.\n", fname, lineno, argv[2] );
|
||||
} else {
|
||||
for ( i = 2; i < argc; i++ ) {
|
||||
if ( strcasecmp( argv[i], "async" ) == 0 ) {
|
||||
async = 1;
|
||||
|
||||
} else if ( strcasecmp( argv[i], "advertize" ) == 0 ) {
|
||||
advertize = 1;
|
||||
|
||||
} else {
|
||||
fprintf( stderr, "%s: line %d: unrecognized option "
|
||||
"\"%s\" ignored.\n", fname, lineno, argv[i] );
|
||||
}
|
||||
}
|
||||
ber_str2bv( argv[1], 0, 0, &bv );
|
||||
|
|
@ -792,6 +799,9 @@ glue_db_config(
|
|||
return -1;
|
||||
}
|
||||
SLAP_DBFLAGS(b2) |= SLAP_DBFLAG_GLUE_SUBORDINATE;
|
||||
if ( advertize ) {
|
||||
SLAP_DBFLAGS(b2) |= SLAP_DBFLAG_GLUE_ADVERTIZE;
|
||||
}
|
||||
gi = (glueinfo *)ch_realloc( gi, sizeof(glueinfo) +
|
||||
gi->gi_nodes * sizeof(gluenode));
|
||||
gi->gi_n[gi->gi_nodes].gn_bx = b2 - backendDB;
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ root_dse_info(
|
|||
}
|
||||
continue;
|
||||
}
|
||||
if ( SLAP_GLUE_SUBORDINATE( &backends[i] ) ) {
|
||||
if ( SLAP_GLUE_SUBORDINATE( &backends[i] ) && !SLAP_GLUE_ADVERTIZE( &backends[i] ) ) {
|
||||
continue;
|
||||
}
|
||||
for ( j = 0; backends[i].be_suffix[j].bv_val != NULL; j++ ) {
|
||||
|
|
|
|||
|
|
@ -1597,8 +1597,9 @@ struct slap_backend_db {
|
|||
#define SLAP_DBFLAG_GLUE_INSTANCE 0x0010U /* a glue backend */
|
||||
#define SLAP_DBFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
|
||||
#define SLAP_DBFLAG_GLUE_LINKED 0x0040U /* child is connected to parent */
|
||||
#define SLAP_DBFLAG_OVERLAY 0x0080U /* this db struct is an overlay */
|
||||
#define SLAP_DBFLAG_GLOBAL_OVERLAY 0x0100U /* this db struct is a global overlay */
|
||||
#define SLAP_DBFLAG_GLUE_ADVERTIZE 0x0080U /* advertize in rootDSE */
|
||||
#define SLAP_DBFLAG_OVERLAY 0x0100U /* this db struct is an overlay */
|
||||
#define SLAP_DBFLAG_GLOBAL_OVERLAY 0x0200U /* this db struct is a global overlay */
|
||||
#define SLAP_DBFLAG_SHADOW 0x8000U /* a shadow */
|
||||
#define SLAP_DBFLAG_SYNC_SHADOW 0x1000U /* a sync shadow */
|
||||
#define SLAP_DBFLAG_SLURP_SHADOW 0x2000U /* a slurp shadow */
|
||||
|
|
@ -1615,6 +1616,8 @@ struct slap_backend_db {
|
|||
(SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLUE_SUBORDINATE)
|
||||
#define SLAP_GLUE_LINKED(be) \
|
||||
(SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLUE_LINKED)
|
||||
#define SLAP_GLUE_ADVERTIZE(be) \
|
||||
(SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLUE_ADVERTIZE)
|
||||
#define SLAP_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SHADOW)
|
||||
#define SLAP_SYNC_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SYNC_SHADOW)
|
||||
#define SLAP_SLURP_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SLURP_SHADOW)
|
||||
|
|
|
|||
Loading…
Reference in a new issue