From c9ca7d69977f90712c8a8124f7b04001361e82ef Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 11 Jul 2023 22:02:49 -0400 Subject: [PATCH] polkit: patch to support turnstile --- srcpkgs/polkit/patches/turnstile.patch | 57 ++++++++++++++++++++++++++ srcpkgs/polkit/template | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/polkit/patches/turnstile.patch diff --git a/srcpkgs/polkit/patches/turnstile.patch b/srcpkgs/polkit/patches/turnstile.patch new file mode 100644 index 00000000000..4f56ed130ee --- /dev/null +++ b/srcpkgs/polkit/patches/turnstile.patch @@ -0,0 +1,57 @@ +commit 8d98aa421b92765695af13c033cf7e80375c03fe +Author: q66 +Date: Sun Jul 2 15:44:51 2023 +0200 + + ensure turnstile-session processes fall back to display check + + As turnstile session is shared between sessions, let us fall back + to the check for whether a graphical session is in place. We need + this as our dbus session bus is managed through turnstile. In + systemd-using systems there is no problem because user units are + not a part of any explicit session (we don't get this luxury + because using a session is the only way to make sure our pid is + tracked in systemd at all; we need that to be able to resolve + PID to UID). + +diff --git a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c +index b00cdbd..9a3f3c3 100644 +--- a/src/polkitbackend/polkitbackendsessionmonitor-systemd.c ++++ b/src/polkitbackend/polkitbackendsessionmonitor-systemd.c +@@ -346,7 +346,7 @@ polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMoni + PolkitUnixProcess *tmp_process = NULL; + PolkitUnixProcess *process = NULL; + PolkitSubject *session = NULL; +- char *session_id = NULL; ++ char *session_id = NULL, *service_id = NULL; + pid_t pid; + #if HAVE_SD_UID_GET_DISPLAY + uid_t uid; +@@ -377,8 +377,26 @@ polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMoni + + if (sd_pid_get_session (pid, &session_id) >= 0) + { +- session = polkit_unix_session_new (session_id); +- goto out; ++ /* if belonging to turnstile, ignore */ ++ if (sd_session_get_service (session_id, &service_id) >= 0) ++ { ++ if (strcmp (service_id, "turnstiled")) ++ { ++ free (service_id); ++ session = polkit_unix_session_new (session_id); ++ goto out; ++ } ++ else ++ { ++ /* turnstile-managed processes are shared */ ++ free(service_id); ++ } ++ } ++ else ++ { ++ session = polkit_unix_session_new (session_id); ++ goto out; ++ } + } + + #if HAVE_SD_UID_GET_DISPLAY diff --git a/srcpkgs/polkit/template b/srcpkgs/polkit/template index 84ab7453bb9..0435e1ce597 100644 --- a/srcpkgs/polkit/template +++ b/srcpkgs/polkit/template @@ -1,7 +1,7 @@ # Template file for 'polkit' pkgname=polkit version=121 -revision=1 +revision=2 build_style=meson build_helper=gir configure_args="$(vopt_bool gir introspection) -Dman=true