X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconfig.c;h=7442953c7d19dc774b3a320dc9ee712a1f286664;hb=f8fb4aca7668c722f41941be719203aa8c298e12;hp=11a295c59d3d6b3b902328bf2321a5d82350dd15;hpb=975a5e9a24e971197baa9ea2d4479100977c9060;p=openldap diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 11a295c59d..7442953c7d 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -1,7 +1,7 @@ /* 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 */ @@ -40,7 +40,6 @@ slap_mask_t global_disallows = 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; @@ -76,14 +75,13 @@ read_config( const char *fname ) 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; @@ -262,11 +260,11 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing max in \"sockbuf_max_incoming \" line\n", fname, lineno )); #else Debug( LDAP_DEBUG_ANY, - "%s: line %d: missing max in \"sockbuf_max_incoming \" line\n", fname, lineno, 0 ); #endif @@ -844,7 +842,7 @@ read_config( const char *fname ) fname, lineno, 0 ); #endif } else { - be->be_glueflags |= SLAP_GLUE_SUBORDINATE; + be->be_flags |= SLAP_BFLAG_GLUE_SUBORDINATE; num_subordinates++; } @@ -1057,7 +1055,7 @@ read_config( const char *fname ) 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 " @@ -1094,7 +1092,7 @@ read_config( const char *fname ) 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 " @@ -1580,8 +1578,8 @@ read_config( const char *fname ) 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 @@ -1689,6 +1687,15 @@ read_config( const char *fname ) 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; @@ -1917,8 +1924,8 @@ read_config( const char *fname ) 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 */ @@ -1986,15 +1993,17 @@ read_config( const char *fname ) 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 */