diff --git a/src/config.c b/src/config.c index 16d08419..63d44642 100644 --- a/src/config.c +++ b/src/config.c @@ -411,6 +411,11 @@ static int iroutes_handler(void *_ctx, const char *section, const char *name, co int ret; char *value; + if (section != NULL && section[0] != 0) { + fprintf(stderr, WARNSTR"skipping unknown section '%s'\n", section); + return 0; + } + if (strcmp(name, "iroute")!=0) return 0; @@ -508,6 +513,12 @@ static int cfg_ini_handler(void *_ctx, const char *section, const char *name, co unsigned prefix4 = 0; char *value; + if (section != NULL && section[0] != 0) { + if (reload == 0) + fprintf(stderr, WARNSTR"skipping unknown section '%s'\n", section); + return 0; + } + value = sanitize_config_value(config, _value); if (value == NULL) return 0; @@ -818,10 +829,6 @@ static int cfg_ini_handler(void *_ctx, const char *section, const char *name, co } else { if (reload == 0) fprintf(stderr, WARNSTR"skipping unknown option '%s'\n", name); -#if 0 - else - fprintf(stderr, NOTESTR"skipping option '%s'\n", name); -#endif } exit: diff --git a/src/sup-config/file.c b/src/sup-config/file.c index 5acde206..ef074021 100644 --- a/src/sup-config/file.c +++ b/src/sup-config/file.c @@ -92,6 +92,11 @@ static int group_cfg_ini_handler(void *_ctx, const char *section, const char *na int ret; char *value; + if (section != NULL && section[0] != 0) { + syslog(LOG_INFO, "skipping unknown section '%s' in %s", section, file); + return 0; + } + value = sanitize_config_value(ctx->pool, _value); if (value == NULL) return 0; @@ -187,7 +192,7 @@ static int group_cfg_ini_handler(void *_ctx, const char *section, const char *na return -1; } } else { - syslog(LOG_ERR, "skipping unknown option '%s' in %s", name, file); + syslog(LOG_INFO, "skipping unknown option '%s' in %s", name, file); } talloc_free(value);