From 422015388dbe35d4543380f0a1a80b83f2e5429c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 15 May 2014 10:57:40 +0300 Subject: [PATCH] core: Add "Policy" to valid main.conf groups --- src/main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index be757d749..7402665b9 100644 --- a/src/main.c +++ b/src/main.c @@ -139,6 +139,7 @@ done: static void check_config(GKeyFile *config) { + const char *valid_groups[] = { "General", "Policy", NULL }; char **keys; int i; @@ -148,7 +149,17 @@ static void check_config(GKeyFile *config) keys = g_key_file_get_groups(config, NULL); for (i = 0; keys != NULL && keys[i] != NULL; i++) { - if (!g_str_equal(keys[i], "General")) + const char **group; + bool match = false; + + for (group = valid_groups; *group; group++) { + if (g_str_equal(keys[i], *group)) { + match = true; + break; + } + } + + if (!match) warn("Unknown group %s in main.conf", keys[i]); } -- 2.47.3