Only use ENOENT for missing configuration file.
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>
D_ERR("conf: unknown option [%s] -> \"%s\"\n",
state->s->name,
name);
- state->err = ENOENT;
+ state->err = EINVAL;
return false;
}
}
s = conf_section_find(conf, section);
if (s == NULL) {
- return ENOENT;
+ return EINVAL;
}
opt = conf_option_find(s, key);
if (opt == NULL) {
- return ENOENT;
+ return EINVAL;
}
if (opt->type != value->type) {
- return ENOENT;
+ return EINVAL;
}
ok = conf_option_same_value(opt, value);
s = conf_section_find(conf, section);
if (s == NULL) {
- return ENOENT;
+ return EINVAL;
}
opt = conf_option_find(s, key);
if (opt == NULL) {
- return ENOENT;
+ return EINVAL;
}
if (opt->type != type) {
key2 = 20
EOF
-required_result 2 <<EOF
+required_error EINVAL <<EOF
conf: unknown option [section1] -> "foo"
[section1]
# key1 = value1
log level = debug
EOF
-required_result 2 <<EOF
+required_error EINVAL <<EOF
conf: unknown option [database] -> "unknown key"
Failed to load config file $conffile
EOF