]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/config.c
Tone down debug messages
[openldap] / servers / slapd / config.c
index 13cf3f619e18d51087c3fff187b29f54e34d3b9d..649be367e77b29839880bb4c93d0854fae406546 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * 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);
                }
@@ -628,6 +628,7 @@ config_parse_vals(ConfigTable *ct, ConfigArgs *c, int valx)
        }
        rc = config_check_vals( ct, c, 1 );
        ch_free( c->tline );
+       c->tline = NULL;
 
        if ( rc )
                rc = LDAP_CONSTRAINT_VIOLATION;
@@ -804,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 ) {
@@ -830,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;