mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
media-session: set permissions on restricted access clients
This commit is contained in:
parent
9364253886
commit
83517e22ac
1 changed files with 13 additions and 4 deletions
|
|
@ -701,6 +701,7 @@ handle_client(struct impl *impl, uint32_t id, uint32_t parent_id,
|
||||||
struct pw_proxy *p;
|
struct pw_proxy *p;
|
||||||
struct client *client;
|
struct client *client;
|
||||||
struct spa_dict_item items[2];
|
struct spa_dict_item items[2];
|
||||||
|
const char *str;
|
||||||
|
|
||||||
p = pw_registry_proxy_bind(impl->registry_proxy,
|
p = pw_registry_proxy_bind(impl->registry_proxy,
|
||||||
id, type, PW_VERSION_CLIENT,
|
id, type, PW_VERSION_CLIENT,
|
||||||
|
|
@ -718,11 +719,19 @@ handle_client(struct impl *impl, uint32_t id, uint32_t parent_id,
|
||||||
add_object(impl, &client->obj);
|
add_object(impl, &client->obj);
|
||||||
spa_list_append(&impl->client_list, &client->l);
|
spa_list_append(&impl->client_list, &client->l);
|
||||||
|
|
||||||
items[0].key = PW_CORE_PROXY_PERMISSIONS_DEFAULT;
|
if (props == NULL)
|
||||||
items[0].value = "rwx";
|
return 0;
|
||||||
|
|
||||||
pw_client_proxy_update_permissions((struct pw_client_proxy*)p,
|
str = spa_dict_lookup(props, "pipewire.access");
|
||||||
&SPA_DICT_INIT(items, 1));
|
if (str == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (strcmp(str, "restricted") == 0) {
|
||||||
|
items[0].key = PW_CORE_PROXY_PERMISSIONS_DEFAULT;
|
||||||
|
items[0].value = "rwx";
|
||||||
|
pw_client_proxy_update_permissions((struct pw_client_proxy*)p,
|
||||||
|
&SPA_DICT_INIT(items, 1));
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue