.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
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";
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;
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 );
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;
}
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++ ) {
#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 */
(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)