summaryrefslogtreecommitdiffstats
path: root/src/conffile.c
diff options
context:
space:
mode:
authorCorubba Smith <corubba@gmx.de>2025-03-12 15:55:55 +0100
committerFlorian Westphal <fw@strlen.de>2025-03-12 16:28:51 +0100
commit51d46956e78b0bc204209f2fbbd0f2ce8d366aa7 (patch)
tree40ecac74ce11ded0e8981a1fe858dc06d328f1e1 /src/conffile.c
parenta6229ae0bbeb8fcb7f9ee5d1dddaae98c0c71176 (diff)
ulogd: provide default configure implementation
Provide a default implementation for the configure hook which simply calls ulogd_parse_configfile(), so simple plugins only need to provide the config_keyset. This also triggers an "unknown key" error if a plugin defines no config_keyset (aka it has no options), but the config file contains directives for it. Signed-off-by: Corubba Smith <corubba@gmx.de> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/conffile.c')
-rw-r--r--src/conffile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/conffile.c b/src/conffile.c
index 955956a..e55ff30 100644
--- a/src/conffile.c
+++ b/src/conffile.c
@@ -158,7 +158,12 @@ int config_parse_file(const char *section, struct config_keyset *kset)
}
if (!found) {
- err = -ERRSECTION;
+ if (kset->num_ces == 0) {
+ /* If there are no options, then no section isnt an error. */
+ err = 0;
+ } else {
+ err = -ERRSECTION;
+ }
goto cpf_error;
}