]> git.sur5r.net Git - openldap/commitdiff
use appropriate log level if bailing out; need to use Debug() instead fprintf( stderr...
authorPierangelo Masarati <ando@openldap.org>
Fri, 6 May 2005 20:36:59 +0000 (20:36 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 6 May 2005 20:36:59 +0000 (20:36 +0000)
servers/slapd/bconfig.c
servers/slapd/config.c
servers/slapd/slap.h

index 8518613d363d36549eba7680d517ea6af4db8405..49ef640e9db19317fef6a5a7a2555e61121c6fc7 100644 (file)
@@ -1241,9 +1241,10 @@ config_generic(ConfigArgs *c) {
 
 
                default:
-                       Debug(LDAP_DEBUG_ANY, "%s: unknown CFG_TYPE %d"
+                       Debug( SLAPD_DEBUG_CONFIG_ERROR,
+                               "%s: unknown CFG_TYPE %d"
                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
-                               c->log, c->type, 0);
+                               c->log, c->type, 0 );
 #ifdef SLAPD_CONF_UNKNOWN_BAILOUT
                        return 1;
 #endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
@@ -1431,7 +1432,7 @@ config_sizelimit(ConfigArgs *c) {
                                                c->log, c->msg, c->argv[i]);
                                        return(1);
                                } else if(next[0] != '\0') {
-                                       Debug(LDAP_DEBUG_ANY, "%s: "
+                                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                                "trailing chars \"%s\" in \"sizelimit <limit>\" line"
                                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                                c->log, next, 0);
@@ -1488,7 +1489,7 @@ config_timelimit(ConfigArgs *c) {
                                                c->log, c->msg, c->argv[i]);
                                        return(1);
                                } else if(next[0] != '\0') {
-                                       Debug(LDAP_DEBUG_ANY, "%s: "
+                                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                                "trailing chars \"%s\" in \"timelimit <limit>\" line"
                                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                                c->log, next, 0);
@@ -1512,7 +1513,7 @@ config_overlay(ConfigArgs *c) {
        }
        if(c->argv[1][0] == '-' && overlay_config(c->be, &c->argv[1][1])) {
                /* log error */
-               Debug(LDAP_DEBUG_ANY, "%s: (optional) %s overlay \"%s\" configuration failed"
+               Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: (optional) %s overlay \"%s\" configuration failed"
                        SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                        c->log, c->be == frontendDB ? "global " : "", c->argv[1][1]);
 #ifdef SLAPD_CONF_UNKNOWN_BAILOUT
@@ -1574,7 +1575,8 @@ config_suffix(ConfigArgs *c) {
        ndn = c->value_ndn;
        tbe = select_backend(&ndn, 0, 0);
        if(tbe == c->be) {
-               Debug(LDAP_DEBUG_ANY, "%s: suffix already served by this backend!"
+               Debug( SLAPD_DEBUG_CONFIG_ERROR,
+                       "%s: suffix already served by this backend!"
                        SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                        c->log, 0, 0);
 #ifdef SLAPD_CONF_UNKNOWN_BAILOUT
@@ -2114,7 +2116,7 @@ config_replica(ConfigArgs *c) {
                        if(!strncasecmp(c->argv[i], "suffix=", STRLENOF( "suffix="))) {
                                switch(add_replica_suffix(c->be, nr, c->argv[i] + STRLENOF("suffix="))) {
                                        case 1:
-                                               Debug(LDAP_DEBUG_ANY, "%s: "
+                                               Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                                "suffix \"%s\" in \"replica\" line is not valid for backend"
                                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                                c->log, c->argv[i] + STRLENOF("suffix="), 0);
@@ -2123,7 +2125,7 @@ config_replica(ConfigArgs *c) {
 #endif /* SLAPD_CONF_UNKNOWN_BAILOUT */
                                                break;
                                        case 2:
-                                               Debug(LDAP_DEBUG_ANY, "%s: "
+                                               Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                                "unable to normalize suffix in \"replica\" line"
                                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                                c->log, 0, 0);
index 143a80635845d2e8f89760dd397e28ea6911716a..0af0616762109d930c4f1b7d5ad1314606fabb66 100644 (file)
@@ -569,7 +569,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                }
 
                if ( c->argc < 1 ) {
-                       Debug(LDAP_DEBUG_CONFIG, "%s: bad config line" 
+                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: bad config line" 
                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                c->log, 0, 0);
 #ifdef SLAPD_CONF_UNKNOWN_BAILOUT
@@ -614,7 +614,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                        if ( rc ) {
                                switch(rc) {
                                case SLAP_CONF_UNKNOWN:
-                                       Debug(LDAP_DEBUG_CONFIG, "%s: "
+                                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                                "unknown directive <%s> inside backend info definition"
                                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                                c->log, *c->argv, 0);
@@ -642,7 +642,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                        if ( rc ) {
                                switch(rc) {
                                case SLAP_CONF_UNKNOWN:
-                                       Debug( LDAP_DEBUG_CONFIG, "%s: "
+                                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                                "unknown directive <%s> inside backend database "
                                                "definition" SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                                c->log, *c->argv, 0);
@@ -660,7 +660,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                        if ( rc ) {
                                switch(rc) {
                                case SLAP_CONF_UNKNOWN:
-                                       Debug( LDAP_DEBUG_CONFIG, "%s: "
+                                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                                "unknown directive <%s> inside global database definition"
                                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                                c->log, *c->argv, 0);
@@ -674,7 +674,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                        }
                        
                } else {
-                       Debug(LDAP_DEBUG_CONFIG, "%s: "
+                       Debug( SLAPD_DEBUG_CONFIG_ERROR, "%s: "
                                "unknown directive <%s> outside backend info and database definitions"
                                SLAPD_CONF_UNKNOWN_IGNORED ".\n",
                                c->log, *c->argv, 0);
index 9031c86c46a3c5b66f84ab90594cd705263897c1..ec075734e73b22f3cde84810175b94732ed54755 100644 (file)
@@ -81,8 +81,10 @@ LDAP_BEGIN_DECL
  */
 #ifdef SLAPD_CONF_UNKNOWN_BAILOUT
 #define        SLAPD_CONF_UNKNOWN_IGNORED      ""
+#define SLAPD_DEBUG_CONFIG_ERROR       LDAP_DEBUG_ANY
 #else /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
 #define        SLAPD_CONF_UNKNOWN_IGNORED      " (ignored)"
+#define SLAPD_DEBUG_CONFIG_ERROR       LDAP_DEBUG_CONFIG
 #endif /* ! SLAPD_CONF_UNKNOWN_BAILOUT */
 
 /*