From 4084db86418285f93465318633bade80d6e1907f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 20 Jan 2021 12:12:56 +0100 Subject: [PATCH] module-access: Relax access check errors Assume -EACCES is a normal thing when checking /proc//root and continue with just an info message. Log a warning and assume flatpak for all other errors. Fixes #432 --- src/modules/module-access.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/module-access.c b/src/modules/module-access.c index 786e52dd8..b663e0c66 100644 --- a/src/modules/module-access.c +++ b/src/modules/module-access.c @@ -110,7 +110,7 @@ static int check_flatpak(struct pw_impl_client *client, int pid) /* Not able to open the root dir shouldn't happen. Probably the app died and * we're failing due to /proc/$pid not existing. In that case fail instead * of treating this as privileged. */ - pw_log_error("failed to open \"%s\": %s", root_path, spa_strerror(res)); + pw_log_info("failed to open \"%s\": %s", root_path, spa_strerror(res)); return res; } info_fd = openat (root_fd, ".flatpak-info", O_RDONLY | O_CLOEXEC | O_NOCTTY); @@ -204,12 +204,12 @@ context_check_access(void *data, struct pw_impl_client *client) res = check_flatpak(client, pid); if (res != 0) { if (res < 0) { - pw_log_warn(NAME" %p: client %p sandbox check failed: %s", - impl, client, spa_strerror(res)); if (res == -EACCES) { access = "unrestricted"; goto granted; } + pw_log_warn(NAME" %p: client %p sandbox check failed: %s", + impl, client, spa_strerror(res)); } else if (res > 0) { pw_log_debug(NAME" %p: flatpak client %p added", impl, client);