mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
global: combine all permissions of the object tree
To get the permissions of an object, combine the permissions of the object and all the parent nodes up to the root. This is necessary to enforce that a client can never see and object id (in this case the parent id) it is not allowed to see.
This commit is contained in:
parent
23d0b9e5e2
commit
9221b8dedd
1 changed files with 9 additions and 3 deletions
|
|
@ -45,11 +45,17 @@ struct impl {
|
|||
SPA_EXPORT
|
||||
uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client)
|
||||
{
|
||||
uint32_t perms = PW_PERM_RWX;
|
||||
uint32_t perms;
|
||||
|
||||
if (client->permission_func != NULL)
|
||||
if (client->permission_func == NULL)
|
||||
return PW_PERM_RWX;
|
||||
|
||||
perms = client->permission_func(global, client, client->permission_data);
|
||||
|
||||
while (global != global->parent) {
|
||||
global = global->parent;
|
||||
perms &= client->permission_func(global, client, client->permission_data);
|
||||
|
||||
}
|
||||
return perms;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue