unetmsg: fix issuing requests without previously subscribing
Perform ACL check if not subscribed. Helps with one-shot requests. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
55cff42121
commit
6fcaf3d589
2 changed files with 6 additions and 2 deletions
|
@ -72,8 +72,11 @@ function client_request(cl, req)
|
|||
return core.handle_message(handle, data, true);
|
||||
case "request":
|
||||
handle = cl.subscribe[name];
|
||||
if (!handle)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
if (!handle &&
|
||||
!core.acl_check("subscribe", cl.acl, [ name ]))
|
||||
return libubus.STATUS_PERMISSION_DENIED;
|
||||
|
||||
handle ??= { client: cl.id };
|
||||
return core.handle_request(handle, req, data, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ function handle_request(handle, req, data, remote)
|
|||
|
||||
for (let cur in handles) {
|
||||
if (!cur || !cur.get_channel) {
|
||||
cb();
|
||||
continue;
|
||||
}
|
||||
let chan = cur.get_channel();
|
||||
|
|
Loading…
Reference in a new issue