Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sys-auth/polkit/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST polkit-0.119.tar.gz 1387409 SHA512 0260fb15da1c4c1f429e8223260981e64e297f1be8ced42f6910f09ea6581b8205aca06c9c601eb4a128acba2f468de0223118f96862ba769f95721894cf1578
DIST polkit-0.120.tar.gz 1626659 SHA512 db072769439d5e17d0eed681e7b94251b77828c1474b40fe40b94293903a64333e7fa17515a3270648691f04a1374d8b404405ead6abf292a8eb8483164adc46
DIST polkit-126-d627b0d.tar.gz 456234 BLAKE2B ad2ee24409b585b8ac03d2c11ac41d570651498a8c5faac763c2ea65b0118c18ee7c3813e020e723fabd32a371a10844cceb13bdb0858b5ab4a3613740773883 SHA512 8d1a5976b339dd891d6bb6ac9827d3113f7dbb01918c09c3de13cbfa83e6829b7f44a5688ebefcca876cf2054a7dfc9db6af97c1768996c63dbdbd17145112c5
99 changes: 99 additions & 0 deletions sys-auth/polkit/files/polkit-126-dbusmock.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
https://github.com/polkit-org/polkit/commit/690e6972ffe30473dacbfaa81158f5507cef99f6
https://github.com/polkit-org/polkit/commit/247952425829e41a47e83b2e433b9703713739f5

From 690e6972ffe30473dacbfaa81158f5507cef99f6 Mon Sep 17 00:00:00 2001
From: Jan Rybar <jrybar@redhat.com>
Date: Wed, 1 Oct 2025 13:23:45 +0200
Subject: [PATCH] DBusMock: CI broken after stop_dbus() removal

Because stop_dbus() was removed from DBusMock implementation, nothing
actually stops the system bus in testing environment in the wrapper.py
child process, hence the test times out into failure.
Adding simple kill(<dbus_PID>) in atexit() is sufficient, but the
original implementation in DBusMock seemed more graceful, so it was
pulled back in.
---
test/wrapper.py | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/test/wrapper.py b/test/wrapper.py
index 14f4abdb..dc62f702 100755
--- a/test/wrapper.py
+++ b/test/wrapper.py
@@ -5,6 +5,8 @@
import os
import subprocess
import sys
+import signal
+import time

import dbus
import dbus.mainloop.glib
@@ -36,6 +38,36 @@ def setup_test_namespace(data_dir):
print("Python 3.12 is required for os.unshare(), skipping")
sys.exit(77)

+
+def stop_dbus(pid: int) -> None:
+ """Stop a D-Bus daemon
+
+ If DBus daemon is not explicitly killed in the testing environment
+ the test times out and reports as failed.
+ This is a backport of a function dropped from DBusMock source (99c4800e9eed).
+ """
+ signal.signal(signal.SIGTERM, signal.SIG_IGN)
+ for _ in range(50):
+ try:
+ os.kill(pid, signal.SIGTERM)
+ os.waitpid(pid, os.WNOHANG)
+ except ChildProcessError:
+ break
+ except OSError as e:
+ if e.errno == errno.ESRCH:
+ break
+ raise
+ time.sleep(0.1)
+ else:
+ sys.stderr.write("ERROR: timed out waiting for bus process to terminate\n")
+ os.kill(pid, signal.SIGKILL)
+ try:
+ os.waitpid(pid, 0)
+ except ChildProcessError:
+ pass
+ signal.signal(signal.SIGTERM, signal.SIG_DFL)
+
+
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("test_executable",
@@ -51,7 +83,7 @@ def setup_test_namespace(data_dir):
if args.mock_dbus:
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
dbusmock.DBusTestCase.start_system_bus()
- atexit.register(dbusmock.DBusTestCase.stop_dbus, dbusmock.DBusTestCase.system_bus_pid)
+ atexit.register(stop_dbus, dbusmock.DBusTestCase.system_bus_pid)

print(f"Executing '{args.test_executable}'")
sys.stdout.flush()

From 247952425829e41a47e83b2e433b9703713739f5 Mon Sep 17 00:00:00 2001
From: Jan Rybar <jrybar@redhat.com>
Date: Sun, 5 Oct 2025 16:40:30 +0200
Subject: [PATCH] Missed 'errno' import in wrapper

---
test/wrapper.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/test/wrapper.py b/test/wrapper.py
index dc62f70..9547720 100755
--- a/test/wrapper.py
+++ b/test/wrapper.py
@@ -7,6 +7,7 @@
import sys
import signal
import time
+import errno

import dbus
import dbus.mainloop.glib
37 changes: 37 additions & 0 deletions sys-auth/polkit/files/polkit-126-elogind.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
https://github.com/polkit-org/polkit/commit/55ee1b70456eca8281dda9612c485c619122f202

From 55ee1b70456eca8281dda9612c485c619122f202 Mon Sep 17 00:00:00 2001
From: Jan Rybar <jrybar@redhat.com>
Date: Tue, 14 Jan 2025 13:47:54 +0100
Subject: [PATCH] meson: fix unused dependency, fixes elogind FTBFS

polkit-126 could not be built from source with elogind session service due
to wrong dependencies in meson.build.

Author: @markhindley
---
src/polkitbackend/meson.build | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/polkitbackend/meson.build b/src/polkitbackend/meson.build
index fc35e195..a807b41b 100644
--- a/src/polkitbackend/meson.build
+++ b/src/polkitbackend/meson.build
@@ -37,7 +37,6 @@ deps += thread_dep

if enable_logind
sources += files('polkitbackendsessionmonitor-systemd.c')
-
deps += logind_dep
else
sources += files('polkitbackendsessionmonitor.c')
@@ -73,7 +72,7 @@ executable(
program,
program + '.c',
include_directories: top_inc,
- dependencies: libpolkit_gobject_dep,
+ dependencies: deps,
c_args: c_flags,
link_with: libpolkit_backend,
install: true,

110 changes: 110 additions & 0 deletions sys-auth/polkit/polkit-126.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Distributed under the terms of the GNU General Public License v2
# Autogen by MARK Devkit

EAPI=7
inherit meson pam pax-utils systemd user xdg-utils

DESCRIPTION="polkit (formerly PolicyKit) is a toolkit for defining and handling authorizations. It is used for allowing unprivileged processes to speak to privileged processes."
HOMEPAGE="https://github.com/polkit-org/polkit"
SRC_URI="https://api.github.com/repos/polkit-org/polkit/tarball/refs/tags/126 -> polkit-126-d627b0d.tar.gz"
LICENSE="LGPL2+"
SLOT="0"
KEYWORDS="*"
PATCHES=(
"${FILESDIR}/polkit-126-dbusmock.patch"
"${FILESDIR}/polkit-126-elogind.patch"
)
DOCS=(
docs/TODO
HACKING.md
NEWS.md
README.md
)
IUSE="+elogind examples gtk +introspection kde pam"
BDEPEND="app-text/docbook-xml-dtd:4.1.2
app-text/docbook-xsl-stylesheets
dev-libs/gobject-introspection-common
dev-libs/libxslt
sys-devel/gettext
virtual/pkgconfig
introspection? ( dev-libs/gobject-introspection )

"
RDEPEND="dev-lang/duktape
dev-libs/glib:2
dev-libs/expat
elogind? ( sys-auth/elogind )
!elogind? ( sys-apps/systemd )
pam? (
sys-auth/pambase
sys-libs/pam
)

"
DEPEND="${RDEPEND}
"
PDEPEND="gtk? ( || (
gnome-extra/polkit-gnome
lxde-base/lxsession
) )
kde? ( kde-plasma/polkit-kde-agent )

"

post_src_unpack() {
mv polkit-org-polkit-* ${S}
}


pkg_setup() {
local u=polkitd
local g=polkitd
local h=/var/lib/polkit-1
enewgroup ${g}
enewuser ${u} -1 -1 ${h} ${g}
esethome ${u} ${h}
}
src_prepare() {
default
sed -i -e 's|unix-group:@PRIVILEGED_GROUP@|unix-user:@PRIVILEGED_GROUP@|' src/polkitbackend/*-default.rules.in || die
}
src_configure() {
xdg_environment_reset
local emesonargs=(
--localstatedir="${EPREFIX}"/var
-Dauthfw="$(usex pam pam shadow)"
-Dexamples=false
-Dgtk_doc=false
-Dman=true
-Dtests=false
-Dsession_tracking="$(usex elogind 'elogind' 'logind')"
-Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
$(meson_use introspection)
$(usex pam "-Dpam_module_dir=$(getpam_mod_dir)" '')
)
meson_src_configure
}
src_compile() {
meson_src_compile
# Required for polkitd on hardened/PaX due to spidermonkey's JIT
pax-mark mr src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest
}
src_install() {
meson_src_install
if use examples ; then
docinto examples
dodoc src/examples/{*.c,*.policy*}
fi
diropts -m 0700 -o polkitd
keepdir /usr/share/polkit-1/rules.d
fperms u+s /usr/bin/pkexec
fperms u+s /usr/lib/polkit-1/polkit-agent-helper-1
}
pkg_postinst() {
chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
}



# vim: filetype=ebuild