From 1a2cc3e309649b02fe7aa301f0160f579bba6151 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Thu, 27 Jan 2022 10:05:29 +0100 Subject: [PATCH] sys-auth/polkit: Apply Flatcar modifications - Fix config install paths, use systemd-tmpfiles (all configs should be installed to /usr and tmpfiles should be used to create and fix directory permissions instead of the ebuild's postinst.) Signed-off-by: Mathieu Tortuyaux --- .../sys-auth/polkit/files/polkit.conf | 3 +++ .../sys-auth/polkit/polkit-121.ebuild | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/files/polkit.conf diff --git a/sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/files/polkit.conf b/sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/files/polkit.conf new file mode 100644 index 0000000000..9734ff4ba6 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/files/polkit.conf @@ -0,0 +1,3 @@ +d /etc/polkit-1 - - - - - +d /etc/polkit-1/rules.d 0700 polkitd root - - +d /var/lib/polkit-1 0700 polkitd polkitd - - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/polkit-121.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/polkit-121.ebuild index af129636b7..d1c5fde8e9 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/polkit-121.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-auth/polkit/polkit-121.ebuild @@ -4,7 +4,8 @@ EAPI=8 PYTHON_COMPAT=( python3_{8..11} ) -inherit meson pam pax-utils python-any-r1 systemd xdg-utils +TMPFILES_OPTIONAL=1 +inherit meson pam pax-utils python-any-r1 systemd tmpfiles xdg-utils DESCRIPTION="Policy framework for controlling privileges for system-wide services" HOMEPAGE="https://www.freedesktop.org/wiki/Software/polkit https://gitlab.freedesktop.org/polkit/polkit" @@ -137,6 +138,16 @@ src_compile() { src_install() { meson_src_install + dodir /usr/share/polkit-1/rules.d + dodir /usr/lib/pam.d + + mv "${D}"/{etc,usr/share}/polkit-1/rules.d/50-default.rules || die + mv "${D}"/{etc,usr/lib}/pam.d/polkit-1 || die + rmdir "${D}"/etc/polkit-1/rules.d "${D}"/etc/polkit-1 || die + rmdir "${D}"/etc/pam.d || die + + dotmpfiles "${FILESDIR}/polkit.conf" + if use examples ; then docinto examples dodoc src/examples/{*.c,*.policy*} @@ -145,8 +156,3 @@ src_install() { diropts -m 0700 -o polkitd keepdir /usr/share/polkit-1/rules.d } - -pkg_postinst() { - chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d - chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d -}