projects
/
project
/
ubus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ubusd: rename goto label from `error` to `out`
[project/ubus.git]
/
ubusd_acl.c
diff --git
a/ubusd_acl.c
b/ubusd_acl.c
index
eb5cec5
..
4b72663
100644
(file)
--- a/
ubusd_acl.c
+++ b/
ubusd_acl.c
@@
-101,10
+101,13
@@
ubusd_acl_check(struct ubus_client *cl, const char *obj,
struct blob_attr *cur;
int rem;
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);
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);
avl_for_element_to_last(&ubusd_acls, acl, acl, avl) {
int diff = ubusd_acl_match_path(obj, acl->avl.key, NULL);
@@
-171,6
+174,13
@@
ubusd_acl_init_client(struct ubus_client *cl, int fd)
return 0;
}
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)
{
static void
ubusd_acl_file_free(struct ubusd_acl_file *file)
{
@@
-415,13
+425,16
@@
ubusd_reply_add(struct ubus_object *obj)
return;
acl = avl_find_ge_element(&ubusd_acls, obj->path.key, acl, avl);
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;
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);
continue;
c = blobmsg_open_table(&b, NULL);