struct blob_attr *cur;
int rem;
- if (!cl->gid && !cl->uid)
+ if (!cl->uid || !obj)
return 0;
acl = avl_find_ge_element(&ubusd_acls, obj, acl, avl);
+ if (!acl)
+ return -1;
+
avl_for_element_to_last(&ubusd_acls, acl, acl, avl) {
int diff = ubusd_acl_match_path(obj, acl->avl.key, NULL);
return 0;
}
+void
+ubusd_acl_free_client(struct ubus_client *cl)
+{
+ free(cl->group);
+ free(cl->user);
+}
+
static void
ubusd_acl_file_free(struct ubusd_acl_file *file)
{
return;
acl = avl_find_ge_element(&ubusd_acls, obj->path.key, acl, avl);
+ if (!acl)
+ return;
+
avl_for_element_to_last(&ubusd_acls, acl, acl, avl) {
void *c;
if (!acl->priv)
continue;
- if (!ubusd_acl_match_path(obj->path.key, acl->avl.key, NULL))
+ if (ubusd_acl_match_path(obj->path.key, acl->avl.key, NULL))
continue;
c = blobmsg_open_table(&b, NULL);