From 08a459007097ab43dc6bc617aa2238d1ce16d2c6 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 29 Nov 2023 18:44:49 +0200 Subject: [PATCH] module-access: recognize "allowed" as legacy alias for "unrestricted" Previously, it was an alias for "unrestricted" so support that still if access.legacy=true. --- src/modules/module-access.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/module-access.c b/src/modules/module-access.c index fd43c8ff9..2c87f249d 100644 --- a/src/modules/module-access.c +++ b/src/modules/module-access.c @@ -50,6 +50,7 @@ * - If `access.legacy` is enabled, the value is: * * - `"flatpak"`: if client is a Flatpak client + * - `"unrestricted"`: if \ref PW_KEY_CLIENT_ACCESS client property is set to `"allowed"` * - Value of \ref PW_KEY_CLIENT_ACCESS client property, if set * - `"unrestricted"`: otherwise * @@ -199,12 +200,16 @@ context_check_access(void *data, struct pw_impl_client *client) else access = ACCESS_DEFAULT; } else { - if (sandbox_flatpak) + if (sandbox_flatpak) { access = ACCESS_FLATPAK; - else if ((str = pw_properties_get(props, PW_KEY_CLIENT_ACCESS)) != NULL) - access = str; - else + } else if ((str = pw_properties_get(props, PW_KEY_CLIENT_ACCESS)) != NULL) { + if (spa_streq(str, "allowed")) + access = ACCESS_UNRESTRICTED; + else + access = str; + } else { access = ACCESS_UNRESTRICTED; + } } /* Handle resolution */