ctdb-common: Fix log message for conf option with unknown section
authorMartin Schwenke <martin@meltin.net>
Fri, 31 Aug 2018 09:57:56 +0000 (19:57 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 3 Sep 2018 08:52:11 +0000 (10:52 +0200)
This covers both options that appear before a section and options in
unknown sections.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/conf.c
ctdb/tests/cunit/config_test_001.sh

index 669ac23a74bbef2ae8991355c6416a447a22e3a3..a6e0f83032849fa01c4375d6d2e02f9d226474b1 100644 (file)
@@ -1099,11 +1099,12 @@ static bool conf_load_option(const char *name,
 
        if (state->s == NULL) {
                if (state->conf->ignore_unknown) {
-                       D_DEBUG("conf: ignoring unknown option \"%s\"\n",
+                       D_DEBUG("conf: unknown section for option \"%s\"\n",
                                name);
                        return true;
                } else {
-                       D_ERR("conf: unknown option \"%s\"\n", name);
+                       D_ERR("conf: unknown section for option \"%s\"\n",
+                             name);
                        state->err = EINVAL;
                        return false;
                }
index bf1e589c31897dc36cf10fd60c9583524054361b..d5536bc7f2ae3f804213f4397576697ea437e296 100755 (executable)
@@ -81,7 +81,7 @@ foobar = cat
 EOF
 
 required_result 22 <<EOF
-conf: unknown option "foobar"
+conf: unknown section for option "foobar"
 Failed to load config file $conffile
 EOF
 unit_test ctdb-config validate