From 51d46956e78b0bc204209f2fbbd0f2ce8d366aa7 Mon Sep 17 00:00:00 2001 From: Corubba Smith Date: Wed, 12 Mar 2025 15:55:55 +0100 Subject: 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 Signed-off-by: Florian Westphal --- src/conffile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/conffile.c') 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; } -- cgit v1.2.3