config: skip unknown sections

This would allow future extensibility, by making clients which
don't support a section to skip it.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
Nikos Mavrogiannopoulos
2018-01-14 14:57:05 +01:00
parent 1b8079a11a
commit 894cdb7a52
2 changed files with 17 additions and 5 deletions

View File

@@ -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);