diff options
author | Mike Gilbert <floppym@gentoo.org> | 2023-03-22 14:54:59 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2023-03-22 15:46:28 -0400 |
commit | 42190b7caf2d681848601be12d27080c82ef9ecd (patch) | |
tree | 8a5b98021b88d7d7301621fe9c2917ec9e2f9dcf /sys-auth/polkit | |
parent | acct-group/jabber: treeclean (diff) | |
download | gentoo-42190b7caf2d681848601be12d27080c82ef9ecd.tar.gz gentoo-42190b7caf2d681848601be12d27080c82ef9ecd.tar.bz2 gentoo-42190b7caf2d681848601be12d27080c82ef9ecd.zip |
sys-auth/polkit: keepdir /etc/polkit-1/rules.d
Calling keepdir /usr/share/polkit-1/rules.d is pointless because the
package already installs 50-default.rules there.
We want to keepdir /etc/polkit-1/rules.d so that we can ensure the
proper permissions are applied.
Skip setting the mode and owner in src_install if we are not running as
root. This resolves a failure on prefix systems.
Keep the chmod/chown in pkg_postinst to handle upgrades and ensure the
permissions get set if packages are installed out-of-order.
Move both calls behind the 'daemon' USE flag.
Closes: https://github.com/gentoo/gentoo/pull/30298
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-auth/polkit')
-rw-r--r-- | sys-auth/polkit/polkit-122-r1.ebuild (renamed from sys-auth/polkit/polkit-122.ebuild) | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys-auth/polkit/polkit-122.ebuild b/sys-auth/polkit/polkit-122-r1.ebuild index 65f7240d5df0..fc80a36e0f16 100644 --- a/sys-auth/polkit/polkit-122.ebuild +++ b/sys-auth/polkit/polkit-122-r1.ebuild @@ -144,11 +144,17 @@ src_install() { dodoc src/examples/{*.c,*.policy*} fi - diropts -m 0700 -o polkitd - keepdir /usr/share/polkit-1/rules.d + if use daemon; then + if [[ ${EUID} == 0 ]]; then + diropts -m 0700 -o polkitd + fi + keepdir /etc/polkit-1/rules.d + fi } pkg_postinst() { - chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d - chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + if use daemon && [[ ${EUID} == 0 ]]; then + chmod 0700 "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + chown polkitd "${EROOT}"/{etc,usr/share}/polkit-1/rules.d + fi } |