summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-09-16 20:37:10 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-09-16 21:00:50 +0100
commit99ed66cbc47b1fc1ba7572057c0776ccbc6d81d6 (patch)
tree4a1abf0684202a1879fc167912eabdcd8268524b
parent880a8b0ab6ab616cfab8c2048d3663fa6672ee35 (diff)
conf.c: warn when encountering invalid address
-rw-r--r--src/conf.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/conf.c b/src/conf.c
index b96fbce..aa1a770 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -774,11 +774,16 @@ static HANDLE_FUNC (handle_group)
return set_string_arg (&conf->group, line, &match[2]);
}
+static void warn_invalid_address(char *arg, unsigned long lineno) {
+ log_message (LOG_WARNING, "Invalid address %s on line %lu", arg, lineno);
+}
+
static HANDLE_FUNC (handle_allow)
{
char *arg = get_string_arg (line, &match[2]);
- insert_acl (arg, ACL_ALLOW, &conf->access_list);
+ if(insert_acl (arg, ACL_ALLOW, &conf->access_list) < 0)
+ warn_invalid_address (arg, lineno);
safefree (arg);
return 0;
}
@@ -787,7 +792,8 @@ static HANDLE_FUNC (handle_deny)
{
char *arg = get_string_arg (line, &match[2]);
- insert_acl (arg, ACL_DENY, &conf->access_list);
+ if(insert_acl (arg, ACL_DENY, &conf->access_list) < 0)
+ warn_invalid_address (arg, lineno);
safefree (arg);
return 0;
}