mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
media-session: give more permissions to Manager flatpaks
If a flatpak app has the Manager media.category set, assign more permissions to it for now. We should later check with the permission store if this is really allowed.
This commit is contained in:
parent
d85862af71
commit
1581b6cfce
2 changed files with 15 additions and 5 deletions
|
|
@ -67,16 +67,26 @@ static void object_update(void *data)
|
|||
if (client->obj->obj.avail & SM_CLIENT_CHANGE_MASK_INFO &&
|
||||
!client->active) {
|
||||
struct pw_permission permissions[1];
|
||||
uint32_t perms;
|
||||
|
||||
if (client->obj->info == NULL || client->obj->info->props == NULL ||
|
||||
(str = spa_dict_lookup(client->obj->info->props, PW_KEY_ACCESS)) == NULL ||
|
||||
strcmp(str, "flatpak") != 0)
|
||||
return;
|
||||
|
||||
/* limited access for now */
|
||||
pw_log_info(NAME" %p: flatpak client %d granted RX permissions"
|
||||
, impl, client->id);
|
||||
permissions[0] = PW_PERMISSION_INIT(PW_ID_ANY, PW_PERM_R | PW_PERM_X);
|
||||
if ((str = spa_dict_lookup(client->obj->info->props, PW_KEY_MEDIA_CATEGORY)) != NULL &&
|
||||
(strcmp(str, "Manager") == 0)) {
|
||||
/* FIXME, use permission store to check if this app is allowed to
|
||||
* be a manager app */
|
||||
perms = PW_PERM_ALL;
|
||||
} else {
|
||||
/* limited access for everything else */
|
||||
perms = PW_PERM_R | PW_PERM_X;
|
||||
}
|
||||
|
||||
pw_log_info(NAME" %p: flatpak client %d granted 0x%08x permissions"
|
||||
, impl, client->id, perms);
|
||||
permissions[0] = PW_PERMISSION_INIT(PW_ID_ANY, perms);
|
||||
pw_client_update_permissions(client->obj->obj.proxy,
|
||||
1, permissions);
|
||||
client->active = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue