X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd_acl.c;h=4b72663d25aa983cb65b10fae8ba029b099c7c45;hp=15a58d8b2cd659eb97fe2a47f61101a128dcf2e1;hb=6f4e11e1db399074273944329883f9c35e7daef6;hpb=1d2b3bbdbefa4901e34506f86f4b4c4412dbb555 diff --git a/ubusd_acl.c b/ubusd_acl.c index 15a58d8..4b72663 100644 --- a/ubusd_acl.c +++ b/ubusd_acl.c @@ -101,7 +101,7 @@ ubusd_acl_check(struct ubus_client *cl, const char *obj, struct blob_attr *cur; int rem; - if (!cl->uid) + if (!cl->uid || !obj) return 0; acl = avl_find_ge_element(&ubusd_acls, obj, acl, avl); @@ -174,6 +174,13 @@ ubusd_acl_init_client(struct ubus_client *cl, int fd) 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) { @@ -427,7 +434,7 @@ ubusd_reply_add(struct ubus_object *obj) 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);