1
0
forked from mir/linux-vm-tools

fixes #6 polkit rule language version support.

eliminate install prompt.
eliminate bash subshell to install polkit policy.
This commit is contained in:
Rich Moyse 2018-09-28 12:21:03 -04:00
parent 0b13ac2924
commit 5303c94ebf

View File

@ -83,21 +83,20 @@ systemctl enable xrdp.service
systemctl enable xrdp-sesman.service systemctl enable xrdp-sesman.service
# Configure the policy xrdp session # Configure the policy xrdp session
bash -c 'cat > /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf <<EOF # polkit policy definition language changes depending on its version. See issue #61
if [[ "$(pkaction --version | sed -E 's/^[[:alnum:] ]*([[:digit:]]+.*)/\1/' - )" != '0.105' ]]; then
echo "Error: Policy rule specification probably invalid. Expected version: 0.105 detected $(pkaction --version)." >&2
exit 1
fi
polkit.addRule(function(action, subject) { cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
if ((action.id == "org.freedesktop.color-manager.create-device" || [Allow Colord all Users]
action.id == "org.freedesktop.color-manager.modify-profile" || Identity=unix-user:*
action.id == "org.freedesktop.color-manager.delete-device" || Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
action.id == "org.freedesktop.color-manager.create-profile" || ResultAny=no
action.id == "org.freedesktop.color-manager.modify-profile" || ResultInactive=no
action.id == "org.freedesktop.color-manager.delete-profile") && ResultActive=yes
subject.isInGroup("users")) EOF
{
return polkit.Result.YES;
}
});
EOF'
# #
# End XRDP # End XRDP
@ -131,7 +130,7 @@ make
make install make install
#Installing xorgxrdp knocks out ubuntu-desktop from running. We need to reinstall it #Installing xorgxrdp knocks out ubuntu-desktop from running. We need to reinstall it
apt-get install --reinstall ubuntu-desktop apt-get install -y --reinstall ubuntu-desktop
# #
# End XORGXRDP # End XORGXRDP