mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
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:
15
src/config.c
15
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:
|
||||
|
||||
Reference in New Issue
Block a user