detect if trying to make back-monitor shadow

This commit is contained in:
Pierangelo Masarati 2005-11-25 15:16:54 +00:00
parent 6f7b00d891
commit f3c007229f
3 changed files with 19 additions and 6 deletions

View File

@ -2548,8 +2548,18 @@ config_updatedn(ConfigArgs *c) {
BER_BVZERO( &c->value_dn );
BER_BVZERO( &c->value_ndn );
SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SLURP_SHADOW);
return(0);
return config_slurp_shadow( c );
}
int
config_shadow( ConfigArgs *c, int flag )
{
if ( SLAP_MONITOR( c->be ) ) {
Debug( LDAP_DEBUG_ANY, "%s: monitor database cannot be shadow.\n", c->log, 0, 0 );
return 1;
}
SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | flag);
return 0;
}
static int

View File

@ -173,6 +173,10 @@ ConfigTable * config_find_keyword(ConfigTable *ct, ConfigArgs *c);
Entry * config_build_entry( Operation *op, SlapReply *rs, CfEntryInfo *parent,
ConfigArgs *c, struct berval *rdn, ConfigOCs *main, ConfigOCs *extra );
int config_shadow( ConfigArgs *c, int flag );
#define config_slurp_shadow(c) config_shadow((c), SLAP_DBFLAG_SLURP_SHADOW)
#define config_sync_shadow(c) config_shadow((c), SLAP_DBFLAG_SYNC_SHADOW)
/* Make sure we don't exceed the bits reserved for userland */
#define config_check_userland(last) \
assert( ( ( (last) - 1 ) & ARGS_USERLAND ) == ( (last) - 1 ) );

View File

@ -3100,8 +3100,8 @@ add_syncrepl(
int rc = 0;
if ( !( c->be->be_search && c->be->be_add && c->be->be_modify && c->be->be_delete ) ) {
Debug( LDAP_DEBUG_ANY, "database %s does not support operations "
"required for syncrepl\n", c->be->be_type, 0, 0 );
Debug( LDAP_DEBUG_ANY, "%s: database %s does not support operations "
"required for syncrepl\n", c->log, c->be->be_type, 0 );
return 1;
}
si = (syncinfo_t *) ch_calloc( 1, sizeof( syncinfo_t ) );
@ -3329,6 +3329,5 @@ syncrepl_config( ConfigArgs *c )
} else if ( add_syncrepl( c ) ) {
return(1);
}
SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SYNC_SHADOW);
return(0);
return config_sync_shadow( c );
}