2009-03-22 03:58:00 +01:00
|
|
|
#
|
|
|
|
# This script fixes permissions for some files and dirs,
|
|
|
|
# and creates the policykit system user/group.
|
|
|
|
#
|
2009-04-08 03:24:57 +02:00
|
|
|
case "${ACTION}" in
|
2009-03-22 03:58:00 +01:00
|
|
|
pre)
|
|
|
|
;;
|
|
|
|
post)
|
2009-04-08 03:24:57 +02:00
|
|
|
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
|
|
|
|
if ! getent group policykit >/dev/null; then
|
|
|
|
groupadd -r policykit 2>&1 >/dev/null
|
2009-03-22 03:58:00 +01:00
|
|
|
[ $? -ne 0 ] && exit $?
|
|
|
|
echo "Created policykit system group."
|
|
|
|
fi
|
2009-04-08 03:24:57 +02:00
|
|
|
if ! getent passwd policykit >/dev/null; then
|
|
|
|
useradd -c "PolicyKit user" \
|
2009-03-22 03:58:00 +01:00
|
|
|
-d / -s /sbin/nologin -g policykit -r policykit && \
|
2009-04-08 03:24:57 +02:00
|
|
|
passwd -l policykit 2>&1 >/dev/null
|
2009-03-22 03:58:00 +01:00
|
|
|
[ $? -ne 0 ] && exit $?
|
|
|
|
echo "Created policykit system user."
|
|
|
|
fi
|
2009-04-08 03:24:57 +02:00
|
|
|
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
|
2009-03-22 03:58:00 +01:00
|
|
|
for i in polkit-read-auth-helper polkit-revoke-helper \
|
|
|
|
polkit-grant-helper polkit-explicit-grant-helper; do
|
2009-04-08 03:24:57 +02:00
|
|
|
chgrp policykit usr/libexec/$i
|
|
|
|
chmod g+s usr/libexec/$i
|
2009-03-22 03:58:00 +01:00
|
|
|
done
|
2009-04-08 03:24:57 +02:00
|
|
|
chgrp policykit usr/libexec/polkit-grant-helper-pam
|
|
|
|
chmod u+s usr/libexec/polkit-grant-helper-pam
|
2009-03-22 03:58:00 +01:00
|
|
|
;;
|
|
|
|
esac
|