metadata: check M permissions before changing metadata

To change a metadata, we need to be able to read the subject and also
have the M permission on it.
This commit is contained in:
Wim Taymans 2021-06-16 09:30:25 +02:00
parent 9d9e3f2d23
commit f15d585f8d

View file

@ -92,7 +92,7 @@ static int metadata_set_property(void *object,
struct pw_impl_client *client = pw_resource_get_client(resource); struct pw_impl_client *client = pw_resource_get_client(resource);
int res; int res;
if ((res = pw_impl_client_check_permissions(client, subject, PW_PERM_R)) < 0) if ((res = pw_impl_client_check_permissions(client, subject, PW_PERM_R | PW_PERM_M)) < 0)
goto error; goto error;
pw_metadata_set_property(impl->metadata, subject, key, type, value); pw_metadata_set_property(impl->metadata, subject, key, type, value);