/* config.c - configuration file handling routines */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
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;
char *cargv[MAXARGS+1];
int lineno, i;
int rc;
- struct berval *vals[2];
- struct berval val;
+ struct berval vals[2];
+ static int lastmod = ON;
static BackendInfo *bi = NULL;
static BackendDB *be = NULL;
- vals[0] = &val;
- vals[1] = NULL;
+ vals[1].bv_val = NULL;
if ( (fp = fopen( fname, "r" )) == NULL ) {
ldap_syslog = 1;
if ( cargc < 2 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
- "%s: line %d: missing max in \"sockbuf_max_incoming <bytes\" line\n",
+ "%s: line %d: missing max in \"sockbuf_max_incoming <bytes>\" line\n",
fname, lineno ));
#else
Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing max in \"sockbuf_max_incoming <bytes\" line\n",
+ "%s: line %d: missing max in \"sockbuf_max_incoming <bytes>\" line\n",
fname, lineno, 0 );
#endif
fname, lineno, 0 );
#endif
} else {
- be->be_glueflags |= SLAP_GLUE_SUBORDINATE;
+ be->be_flags |= SLAP_BFLAG_GLUE_SUBORDINATE;
num_subordinates++;
}
tmp_be = select_backend( &nalias, 0, 0 );
free( nalias.bv_val );
- if ( tmp_be != be ) {
+ if ( tmp_be && tmp_be != be ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_INFO,
"%s: line %d: suffixAlias served by a preceeding "
tmp_be = select_backend( &naliased, 0, 0 );
free( naliased.bv_val );
- if ( tmp_be != be ) {
+ if ( tmp_be && tmp_be != be ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_INFO,
"%s: line %d: suffixAlias derefs to a different backend "
return 1;
}
- vals[0]->bv_val = cargv[1];
- vals[0]->bv_len = strlen( vals[0]->bv_val );
+ vals[0].bv_val = cargv[1];
+ vals[0].bv_len = strlen( vals[0].bv_val );
value_add( &default_referral, vals );
#ifdef NEW_LOGGING
return( 1 );
}
if ( strcasecmp( cargv[1], "off" ) == 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
+ "%s: line %d: schema checking disabled! your mileage may vary!\n",
+ fname, lineno ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: schema checking disabled! your mileage may vary!\n",
+ fname, lineno, 0 );
+#endif
global_schemacheck = 0;
} else {
global_schemacheck = 1;
return 1;
}
- vals[0]->bv_val = cargv[1];
- vals[0]->bv_len = strlen( vals[0]->bv_val );
+ vals[0].bv_val = cargv[1];
+ vals[0].bv_len = strlen( vals[0].bv_val );
value_add( &be->be_update_refs, vals );
/* replication log file to which changes are appended */
return( 1 );
}
if ( strcasecmp( cargv[1], "on" ) == 0 ) {
- if ( be )
- be->be_lastmod = ON;
- else
- global_lastmod = ON;
+ if ( be ) {
+ be->be_flags &= ~SLAP_BFLAG_NOLASTMOD;
+ } else {
+ lastmod = ON;
+ }
} else {
- if ( be )
- be->be_lastmod = OFF;
- else
- global_lastmod = OFF;
+ if ( be ) {
+ be->be_flags |= SLAP_BFLAG_NOLASTMOD;
+ } else {
+ lastmod = OFF;
+ }
}
/* set idle timeout value */