Merging casper 1.201.
[live-boot-grml.git] / scripts / live-bottom / 44pk_allow
index 7fd026e..a211880 100755 (executable)
@@ -40,12 +40,32 @@ cat << EOF > /root/etc/PolicyKit/PolicyKit.conf
        <match user="root">
                <return result="yes"/>
        </match>
+EOF
+
+if [ -n "${USERNAME}" ]
+then
+       cat << EOF >> /root/etc/PolicyKit/PolicyKit.conf
        <!-- don't ask password for user in live session -->
        <match user="$USERNAME">
                <return result="yes"/>
        </match>
+EOF
+fi
+
+cat << EOF >> /root/etc/PolicyKit/PolicyKit.conf
        <define_admin_auth group="admin"/>
 </config>
 EOF
 
+mkdir -p /root/var/lib/polkit-1/localauthority/10-vendor.d
+cat << EOF > /root/var/lib/polkit-1/localauthority/10-vendor.d/10-live-cd.pkla
+# Policy to allow the livecd user to bypass policykit
+[Live CD user permissions]
+Identity=unix-user:$USERNAME
+Action=*
+ResultAny=no
+ResultInactive=no
+ResultActive=yes
+EOF
+
 log_end_msg