pulse: check that we have access to change metadata

This commit is contained in:
Wim Taymans 2020-07-30 16:23:13 +02:00
parent 8db9a2741b
commit f5e78196c4
2 changed files with 14 additions and 8 deletions

View file

@ -1623,6 +1623,9 @@ static void do_default_node(pa_operation *o, void *userdata)
g = pa_context_find_global_by_name(c, d->mask, d->name);
if (g == NULL) {
error = PA_ERR_NOENTITY;
} else if (!SPA_FLAG_IS_SET(g->permissions, PW_PERM_R) ||
(c->metadata && !SPA_FLAG_IS_SET(c->metadata->permissions, PW_PERM_W|PW_PERM_X))) {
error = PA_ERR_ACCESS;
} else if (c->metadata) {
char buf[16];
snprintf(buf, sizeof(buf), "%d", g->id);