modules: refactor check_flatpak to a common place

Move check_flatpak used by module-access and module-protocol-pulse
to a common flatpak-utils.h
This commit is contained in:
Pauli Virtanen 2022-07-30 21:25:03 +03:00 committed by Wim Taymans
parent f32017c874
commit 5e5339ce6c
3 changed files with 94 additions and 52 deletions

View file

@ -60,6 +60,7 @@
#include "server.h"
#include "stream.h"
#include "utils.h"
#include "flatpak-utils.h"
#define LISTEN_BACKLOG 32
#define MAX_CLIENTS 64
@ -423,7 +424,7 @@ on_connect(void *data, int fd, uint32_t mask)
pw_log_warn("setsockopt(SO_PRIORITY) failed: %m");
#endif
pid = get_client_pid(client, client_fd);
if (pid != 0 && check_flatpak(client, pid) == 1)
if (pid != 0 && pw_check_flatpak(pid) == 1)
client_access = "flatpak";
}
else if (server->addr.ss_family == AF_INET || server->addr.ss_family == AF_INET6) {