summaryrefslogtreecommitdiff
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2015-04-28 17:00:37 -0500
committerMark Michelson <mmichelson@digium.com>2015-04-30 10:43:51 -0500
commit11ffcf662f6b19eb0e9d5f8914d379ebef0177c4 (patch)
treea2727599061f560cce4900094e4854364c9c7add /channels/chan_skinny.c
parent57cbb4bc8dda4cf4939f029e60290e3335a82c05 (diff)
Restrict functionality when ACLs are misconfigured.
This patch has two main purposes: 1) Improve warning messages when ACLs are configured improperly. 2) Prevent misconfigured ACLs from allowing potentially unwanted traffic. To acomplish point (2) in most cases, whatever configuration object that the ACL belonged to was not allowed to load. The one exception is res_pjsip_acl. In that case, ACLs are their own configuration object. Furthermore, the module loading code has no indication that a ACL configuration had a failure. So the tactic taken here is to create an ACL that just blocks everything. ASTERISK-24969 Reported by Corey Farrell Change-Id: I2ebcb6959cefad03cea4d81401be946203fcacae
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 5f30a13b5..1d7d65af4 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -8044,7 +8044,14 @@ static void config_parse_variables(int type, void *item, struct ast_variable *vp
}
} else if (!strcasecmp(v->name, "permit") || !strcasecmp(v->name, "deny")) {
if (type & (TYPE_DEVICE)) {
- CDEV->ha = ast_append_ha(v->name, v->value, CDEV->ha, NULL);
+ int acl_error = 0;
+
+ CDEV->ha = ast_append_ha(v->name, v->value, CDEV->ha, &acl_error);
+ if (acl_error) {
+ ast_log(LOG_ERROR, "Invalid ACL '%s' on line '%d'. Deleting device\n",
+ v->value, v->lineno);
+ CDEV->prune = 1;
+ }
continue;
}
} else if (!strcasecmp(v->name, "allow")) {