void-packages/templates/PolicyKit/INSTALL
Juan RP 5b7e35b5f5 Added PolicyKit-0.9 template.
--HG--
extra : convert_revision : 231021db72f9ea60bcfc247f12eb9c642e28124a
2009-03-22 03:58:00 +01:00

36 lines
1.2 KiB
Text

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