void-packages/templates/PolicyKit/INSTALL

37 lines
1.1 KiB
Plaintext

#
# This script fixes permissions for some files and dirs,
# and creates the policykit system user/group.
#
case "${ACTION}" in
pre)
;;
post)
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
if ! getent group policykit >/dev/null; then
groupadd -r policykit 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created policykit system group."
fi
if ! getent passwd policykit >/dev/null; then
useradd -c "PolicyKit user" \
-d / -s /sbin/nologin -g policykit -r policykit && \
passwd -l policykit 2>&1 >/dev/null
[ $? -ne 0 ] && exit $?
echo "Created policykit system user."
fi
chgrp policykit var/run/PolicyKit
chgrp policykit var/lib/PolicyKit
chown policykit var/lib/PolicyKit-public
chown policykit:policykit var/lib/misc/PolicyKit.reload
chown policykit usr/libexec/polkit-set-default-helper
chmod u+s usr/libexec/polkit-set-default-helper
for i in polkit-read-auth-helper polkit-revoke-helper \
polkit-grant-helper polkit-explicit-grant-helper; do
chgrp policykit usr/libexec/$i
chmod g+s usr/libexec/$i
done
chgrp policykit usr/libexec/polkit-grant-helper-pam
chmod u+s usr/libexec/polkit-grant-helper-pam
;;
esac