module-access: move EACCES check to pw_check_flatpak

Decisions on whether an application is considered Flatpak sandboxed
should be in pw_check_flatpak.

Added the comment from 4169d9196d why we consider EACCES as
non-sandboxed. This is probably OK as it shouldn't occur on functioning
Flatpak setup.
This commit is contained in:
Pauli Virtanen 2022-08-13 21:32:51 +03:00
parent e3a69d1932
commit 4bd1cc8fcd
2 changed files with 11 additions and 17 deletions

View file

@ -263,17 +263,11 @@ context_check_access(void *data, struct pw_impl_client *client)
res = pw_check_flatpak(pid, &flatpak_app_id, NULL);
if (res != 0) {
if (res < 0) {
if (res == -EACCES) {
access = "unrestricted";
goto granted;
}
if (res < 0)
pw_log_warn("%p: client %p sandbox check failed: %s",
impl, client, spa_strerror(res));
}
else if (res > 0) {
else
pw_log_debug(" %p: flatpak client %p added", impl, client);
}
access = "flatpak";
items[nitems++] = SPA_DICT_ITEM_INIT("pipewire.access.portal.app_id",
flatpak_app_id);