X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconfig.c;h=649be367e77b29839880bb4c93d0854fae406546;hb=7ce9e7b7c637a69fa1fdd78cfdfbf2581bb8217e;hp=2f8cd60f4c7b86240245f0e59b8ad26c7ba49bf4;hpb=e788a5c380d53f979d3c7a20e208e9a7429e956d;p=openldap diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 2f8cd60f4c..649be367e7 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2005 The OpenLDAP Foundation. + * Copyright 1998-2006 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -237,20 +237,20 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { { iarg = 0; } else { - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value, ignored", + snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value", c->argv[0] ); - Debug(LDAP_DEBUG_CONFIG, "%s: %s\n", + Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 ); - return(0); + return(ARG_BAD_CONF); } break; } j = (arg_type & ARG_NONZERO) ? 1 : 0; if(iarg < j && larg < j && barg < j ) { larg = larg ? larg : (barg ? barg : iarg); - snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value, ignored", + snprintf( c->msg, sizeof( c->msg ), "<%s> invalid value", c->argv[0] ); - Debug(LDAP_DEBUG_CONFIG, "%s: %s\n", + Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 ); return(ARG_BAD_CONF); } @@ -805,20 +805,29 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft) rc = (*c->be->be_config)(c->be, c->fname, c->lineno, c->argc, c->argv); } - if ( rc ) { - switch(rc) { - case SLAP_CONF_UNKNOWN: - Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: " - "unknown directive <%s> inside backend database " - "definition" SLAPD_CONF_UNKNOWN_IGNORED ".\n", - c->log, *c->argv, 0); + if ( rc == SLAP_CONF_UNKNOWN && SLAP_ISGLOBALOVERLAY( frontendDB ) ) { + /* global overlays may need + * definitions inside other databases... + */ + rc = (*frontendDB->be_config)(frontendDB, c->fname, (int)c->lineno, c->argc, c->argv); + } + + switch ( rc ) { + case 0: + break; + + case SLAP_CONF_UNKNOWN: + Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: " + "unknown directive <%s> inside backend database " + "definition" SLAPD_CONF_UNKNOWN_IGNORED ".\n", + c->log, *c->argv, 0); #ifndef SLAPD_CONF_UNKNOWN_BAILOUT - continue; + break; #endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */ - default: - rc = 1; - goto done; - } + + default: + rc = 1; + goto done; } } else if ( frontendDB->be_config ) { @@ -831,8 +840,9 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft) SLAPD_CONF_UNKNOWN_IGNORED ".\n", c->log, *c->argv, 0); #ifndef SLAPD_CONF_UNKNOWN_BAILOUT - continue; + break; #endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */ + default: rc = 1; goto done;