ubusd_acl: event listen access list support
[project/ubus.git] / ubusd_event.c
index f07f8267869b3806125b279f67d95f45e10c7ee0..6e612a19070b19a2a65577a3143aefeeeab532d9 100644 (file)
@@ -88,6 +88,9 @@ static int ubusd_alloc_event_pattern(struct ubus_client *cl, struct blob_attr *m
                len--;
        }
 
+       if (pattern[0] && ubusd_acl_check(cl, pattern, NULL, UBUS_ACL_LISTEN))
+               return UBUS_STATUS_PERMISSION_DENIED;
+
        ev = calloc(1, sizeof(*ev) + len + 1);
        if (!ev)
                return UBUS_STATUS_NO_DATA;