From 4d4904187be537f6e98b9be85ba69b0d1ac927d9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 17 Jul 2020 13:22:02 +0200 Subject: [PATCH] client: update busy status after check_access So that we block clients without permissions --- src/pipewire/impl-client.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pipewire/impl-client.c b/src/pipewire/impl-client.c index 5044c21a5..0db123444 100644 --- a/src/pipewire/impl-client.c +++ b/src/pipewire/impl-client.c @@ -273,6 +273,13 @@ static const struct pw_context_events context_events = { .global_removed = context_global_removed, }; +static void update_busy(struct pw_impl_client *client) +{ + struct pw_permission *def; + def = find_permission(client, PW_ID_CORE); + pw_impl_client_set_busy(client, (def->permissions & PW_PERM_R) ? false : true); +} + /** Make a new client object * * \param context a \ref pw_context object to register the client with @@ -346,6 +353,8 @@ struct pw_impl_client *pw_context_create_client(struct pw_impl_core *core, pw_context_emit_check_access(this->context, this); + update_busy(this); + return this; error_clear_array: @@ -633,8 +642,7 @@ int pw_impl_client_update_permissions(struct pw_impl_client *client, pw_global_update_permissions(global, client, old_perm, new_perm); } } - def = find_permission(client, PW_ID_CORE); - pw_impl_client_set_busy(client, (def->permissions & PW_PERM_R) ? false : true); + update_busy(client); return 0; }