mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Add SLAP_SHADOW(be): true if be is a shadow database (via any mech)
This commit is contained in:
parent
2fcaa15b90
commit
843400deb7
@ -1801,12 +1801,25 @@ read_config( const char *fname, int depth )
|
||||
"a database definition.\n", fname, lineno, 0);
|
||||
#endif
|
||||
return 1;
|
||||
} else {
|
||||
if ( add_syncrepl( be, cargv, cargc )) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else if ( SLAP_SHADOW( be )) {
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( CONFIG, INFO,
|
||||
"%s: line %d: syncrepl: database already shadowed.\n",
|
||||
fname, lineno, 0);
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"%s: line %d: syncrepl: database already shadowed.\n",
|
||||
fname, lineno, 0);
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
} else if ( add_syncrepl( be, cargv, cargc )) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
SLAP_DBFLAGS(be) |= SLAP_DBFLAG_SHADOW;
|
||||
|
||||
/* list of replicas of the data in this backend (master only) */
|
||||
} else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
|
||||
if ( cargc < 2 ) {
|
||||
@ -2010,6 +2023,18 @@ read_config( const char *fname, int depth )
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
} else if ( SLAP_SHADOW(be) ) {
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( CONFIG, INFO,
|
||||
"%s: line %d: updatedn: database already shadowed.\n",
|
||||
fname, lineno, 0);
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"%s: line %d: updatedn: database already shadowed.\n",
|
||||
fname, lineno, 0);
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
} else {
|
||||
struct berval dn;
|
||||
|
||||
@ -2031,7 +2056,9 @@ read_config( const char *fname, int depth )
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
SLAP_DBFLAGS(be) |= SLAP_DBFLAG_SHADOW;
|
||||
|
||||
} else if ( strcasecmp( cargv[0], "updateref" ) == 0 ) {
|
||||
if ( cargc < 2 ) {
|
||||
@ -2087,8 +2114,9 @@ read_config( const char *fname, int depth )
|
||||
|
||||
vals[0].bv_val = cargv[1];
|
||||
vals[0].bv_len = strlen( vals[0].bv_val );
|
||||
if( value_add( &be->be_update_refs, vals ) )
|
||||
if( value_add( &be->be_update_refs, vals ) ) {
|
||||
return LDAP_OTHER;
|
||||
}
|
||||
|
||||
/* replication log file to which changes are appended */
|
||||
} else if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) {
|
||||
|
@ -1395,6 +1395,9 @@ typedef struct syncinfo_s {
|
||||
struct slap_backend_db {
|
||||
BackendInfo *bd_info; /* pointer to shared backend info */
|
||||
|
||||
/* fields in this structure (and routines acting on this structure)
|
||||
should be renamed from be_ to bd_ */
|
||||
|
||||
/* BackendInfo accessors */
|
||||
#define be_config bd_info->bi_db_config
|
||||
#define be_type bd_info->bi_type
|
||||
@ -1451,6 +1454,7 @@ 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_SHADOW 0x8000U /* a shadow */
|
||||
slap_mask_t be_flags;
|
||||
#define SLAP_DBFLAGS(be) ((be)->be_flags)
|
||||
#define SLAP_NOLASTMOD(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NOLASTMOD)
|
||||
@ -1463,6 +1467,7 @@ 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_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SHADOW)
|
||||
|
||||
slap_mask_t be_restrictops; /* restriction operations */
|
||||
#define SLAP_RESTRICT_OP_ADD 0x0001U
|
||||
@ -1508,7 +1513,6 @@ struct slap_backend_db {
|
||||
/* Required Security Strength Factor */
|
||||
slap_ssf_set_t be_ssf_set;
|
||||
|
||||
/* these should be renamed from be_ to bd_ */
|
||||
BerVarray be_suffix; /* the DN suffixes of data in this backend */
|
||||
BerVarray be_nsuffix; /* the normalized DN suffixes in this backend */
|
||||
struct berval be_schemadn; /* per-backend subschema subentry DN */
|
||||
|
Loading…
Reference in New Issue
Block a user