From 5f65f1cbbee0b307ded7fa032d8d0dbd62472e88 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Tue, 19 Nov 2019 14:23:10 +0200 Subject: [PATCH] client: register the global early, in pw_client_new() otherwise, if the access module blocks the client, the on_start callback in the protocol is not called and there is no global, which means the session manager cannot do anything to grant permissions on this client and the client is blocked forever --- src/modules/module-protocol-native.c | 3 --- src/pipewire/client.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/module-protocol-native.c b/src/modules/module-protocol-native.c index 176dd904e..f9852412f 100644 --- a/src/modules/module-protocol-native.c +++ b/src/modules/module-protocol-native.c @@ -308,9 +308,6 @@ static void on_start(void *data, uint32_t version) if (version == 0) client->compat_v2 = &this->compat_v2; - if (pw_client_register(client, NULL) < 0) - return; - return; } diff --git a/src/pipewire/client.c b/src/pipewire/client.c index 6f58d938a..ea487b1a9 100644 --- a/src/pipewire/client.c +++ b/src/pipewire/client.c @@ -343,6 +343,9 @@ struct pw_client *pw_client_new(struct pw_core *core, pw_core_emit_check_access(core, this); + if ((res = pw_client_register(this, NULL)) < 0) + goto error_clear_array; + return this; error_clear_array: