goto done;
}
- if ( (be->be_lastmod == ON || (be->be_lastmod == UNDEFINED &&
- global_lastmod == ON)) && !repl_user )
- {
+ if ( SLAP_LASTMOD(be) && !repl_user ) {
for( modtail = &modlist;
*modtail != NULL;
modtail = &(*modtail)->sml_next )
for ( j = 0; backends[i].be_nsuffix != NULL &&
backends[i].be_nsuffix[j] != NULL; j++ )
{
- if ((backends[i].be_glueflags&SLAP_GLUE_SUBORDINATE)&&
- noSubs)
+ if (( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE )
+ && noSubs )
+ {
continue;
+ }
len = backends[i].be_nsuffix[j]->bv_len;
/* we won't attempt to send it to a different backend */
be = select_backend( gr_ndn, 0,
- (be->be_glueflags & SLAP_GLUE_INSTANCE));
+ (be->be_flags & SLAP_BFLAG_GLUE_INSTANCE));
if (be == NULL) {
return LDAP_NO_SUCH_OBJECT;
/* we won't attempt to send it to a different backend */
be = select_backend( edn, 0,
- (be->be_glueflags & SLAP_GLUE_INSTANCE));
+ (be->be_flags & SLAP_BFLAG_GLUE_INSTANCE));
if (be == NULL) {
return LDAP_NO_SUCH_OBJECT;
* backends and connect them to their superior.
*/
for (i = nBackendDB - 1, b1=&backendDB[i]; cont && i>=0; b1--,i--) {
- if (b1->be_glueflags & SLAP_GLUE_SUBORDINATE) {
+ if (b1->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
/* The last database cannot be a subordinate of noone */
- if (i == nBackendDB - 1)
- b1->be_glueflags ^= SLAP_GLUE_SUBORDINATE;
+ if (i == nBackendDB - 1) {
+ b1->be_flags ^= SLAP_BFLAG_GLUE_SUBORDINATE;
+ }
continue;
}
gi = NULL;
for (j = i-1, be=&backendDB[j]; j>=0; be--,j--) {
- if (!(be->be_glueflags & SLAP_GLUE_SUBORDINATE))
+ if (!(be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE)) {
continue;
+ }
/* We will only link it once */
- if (be->be_glueflags & SLAP_GLUE_LINKED)
+ if (be->be_flags & SLAP_BFLAG_GLUE_LINKED) {
continue;
- if (!dnIsSuffix(be->be_nsuffix[0],
- b1->be_nsuffix[0]))
+ }
+ if (!dnIsSuffix(be->be_nsuffix[0], b1->be_nsuffix[0])) {
continue;
+ }
cont--;
- be->be_glueflags |= SLAP_GLUE_LINKED;
+ be->be_flags |= SLAP_BFLAG_GLUE_LINKED;
if (gi == NULL) {
/* We create a copy of the superior's be
* structure, pointing to all of its original
* is used whenever we have operations to pass
* down to the real database.
*/
- b1->be_glueflags |= SLAP_GLUE_INSTANCE;
+ b1->be_flags |= SLAP_BFLAG_GLUE_INSTANCE;
gi = (glueinfo *)ch_malloc(sizeof(glueinfo));
- gi->be = (BackendDB *)ch_malloc(sizeof(BackendDB) + sizeof(BackendInfo));
+ gi->be = (BackendDB *)ch_malloc(
+ sizeof(BackendDB) + sizeof(BackendInfo));
bi = (BackendInfo *)(gi->be+1);
*gi->be = *b1;
gi->nodes = 0;
slap_mask_t global_requires = 0;
slap_ssf_set_t global_ssf_set;
char *replogfile;
-int global_lastmod = ON;
int global_idletimeout = 0;
char *global_host = NULL;
char *global_realm = NULL;
int rc;
struct berval vals[2];
+ static int lastmod = ON;
static BackendInfo *bi = NULL;
static BackendDB *be = NULL;
bi = NULL;
be = backend_db_init( cargv[1] );
+ if( lastmod ) be->be_flags |= SLAP_BFLAG_LASTMOD;
+
if( be == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
fname, lineno, 0 );
#endif
} else {
- be->be_glueflags |= SLAP_GLUE_SUBORDINATE;
+ be->be_flags |= SLAP_BFLAG_GLUE_SUBORDINATE;
num_subordinates++;
}
}
if ( strcasecmp( cargv[1], "on" ) == 0 ) {
if ( be )
- be->be_lastmod = ON;
+ be->be_flags |= SLAP_BFLAG_LASTMOD;
else
- global_lastmod = ON;
+ lastmod = ON;
} else {
if ( be )
- be->be_lastmod = OFF;
+ be->be_flags &= ~SLAP_BFLAG_LASTMOD;
else
- global_lastmod = OFF;
+ lastmod = OFF;
}
/* set idle timeout value */
goto cleanup;
}
- if ( (be->be_lastmod == ON || (be->be_lastmod == UNDEFINED &&
- global_lastmod == ON)) && !repl_user )
- {
+ if ( SLAP_LASTMOD(be) && !repl_user ) {
for( modtail = &modlist;
*modtail != NULL;
modtail = &(*modtail)->sml_next )
LDAP_SLAPD_V (struct slap_limits_set) deflimit;
LDAP_SLAPD_V (slap_access_t) global_default_access;
-LDAP_SLAPD_V (int) global_lastmod;
LDAP_SLAPD_V (int) global_idletimeout;
LDAP_SLAPD_V (int) global_schemacheck;
LDAP_SLAPD_V (char *) global_host;
attr_merge( e, ad_objectClass, vals );
for ( i = 0; i < nbackends; i++ ) {
- if ( backends[i].be_glueflags & SLAP_GLUE_SUBORDINATE )
+ if ( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE ) {
continue;
+ }
for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
vals[0] = *backends[i].be_suffix[j];
attr_merge( e, ad_namingContexts, vals );
#define be_sync bd_info->bi_tool_sync
#endif
+#define SLAP_BFLAG_LASTMOD 0x0001U
+
+#define SLAP_BFLAG_GLUE_INSTANCE 0x0010U /* a glue backend */
+#define SLAP_BFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
+#define SLAP_BFLAG_GLUE_LINKED 0x00400 /* child is connected to parent */
+
+#define SLAP_BFLAG_ALIASES 0x0010U
+#define SLAP_BFLAG_MONITOR 0x0020U
+#define SLAP_BFLAG_REFERRALS 0x0040U
+#define SLAP_BFLAG_SUBENTRIES 0x0080U
+
+ slap_mask_t be_flags;
+#define SLAP_LASTMOD(be) ((be)->be_flags & SLAP_BFLAG_LASTMOD)
+
slap_mask_t be_restrictops; /* restriction operations */
#define SLAP_RESTRICT_OP_ADD 0x0001U
#define SLAP_RESTRICT_OP_BIND 0x0002U
struct berval be_update_ndn; /* allowed to make changes (in replicas) */
BVarray be_update_refs; /* where to refer modifying clients to */
char *be_realm;
- int be_lastmod; /* keep track of lastmodified{by,time} */
-
-#define SLAP_GLUE_INSTANCE 0x01 /* a glue backend */
-#define SLAP_GLUE_SUBORDINATE 0x02 /* child of a glue hierarchy */
-#define SLAP_GLUE_LINKED 0x04 /* child is connected to parent */
- int be_glueflags; /* */
void *be_private; /* anything the backend database needs */
};
typedef int (BI_tool_sync) LDAP_P(( BackendDB *be ));
struct slap_backend_info {
- char *bi_type; /* type of backend */
+ char *bi_type; /* type of backend */
/*
* per backend type routines:
/* If the named base is a glue master, operate on the
* entire context
*/
- if (be->be_glueflags & SLAP_GLUE_INSTANCE)
+ if (be->be_flags & SLAP_BFLAG_GLUE_INSTANCE)
nosubordinates = 1;
} else if ( dbnum == -1 ) {
/* If just doing the first by default and it is a
* glue subordinate, find the master.
*/
- while (be->be_glueflags & SLAP_GLUE_SUBORDINATE) {
+ while (be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
nosubordinates = 1;
be++;
}