Selaa lähdekoodia

Upgraded local PolKit policies to Javascript rules

Changes also include a fix for (#444734) issue with rules.d directories
filesystem permissions.
Maxim Kammerer 12 vuotta sitten
vanhempi
commit
0f62305267

+ 3 - 3
enter

@@ -78,9 +78,9 @@ else
     ${RSYNC} --chmod=ug=r,o=     -i ${SRC}/etc/sudoers           ${LIVECD}/etc
     ${RSYNC} --chmod=u=rw,g=r,o= -i ${SRC}/etc/sysctl.conf       ${LIVECD}/etc
 
-    if [ -e ${LIVECD}/etc/polkit-1/localauthority ]; then
-        ${RSYNC} --chmod=u=rwX,go=rX -i --delete-excluded -C \
-            ${SRC}/etc/polkit-1/localauthority/30-site.d ${LIVECD}/etc/polkit-1/localauthority
+    if [ -e ${LIVECD}/etc/polkit-1/rules.d ]; then
+        ${RSYNC} --chmod=u=rwX,go=rX -i -C \
+            ${SRC}/etc/polkit-1/rules.d/* ${LIVECD}/etc/polkit-1/rules.d
     fi
 
     mkdir -p -m 755 ${LIVECD}/usr/local/addons

+ 0 - 6
src/etc/polkit-1/localauthority/30-site.d/10-su.dee.liberte.consolekit.pkla

@@ -1,6 +0,0 @@
-[ConsoleKit Permissions]
-Identity=unix-group:wheel
-Action=org.freedesktop.consolekit.system.stop;org.freedesktop.consolekit.system.stop-multiple-users;org.freedesktop.consolekit.system.restart;org.freedesktop.consolekit.system.restart-multiple-users
-ResultAny=no
-ResultInactive=yes
-ResultActive=yes

+ 7 - 0
src/etc/polkit-1/rules.d/10-su.dee.liberte.consolekit.rules

@@ -0,0 +1,7 @@
+// Let local users in wheel group stop and restart the system
+polkit.addRule(function(action, subject) {
+    if (/^org\.freedesktop\.consolekit\.system\.(stop|stop-multiple-users|restart|restart-multiple-users)$/.test(action.id)
+        &&  subject.isInGroup("wheel")  &&  subject.local) {
+        return polkit.Result.YES;
+    }
+});

+ 7 - 0
src/root/setup-copy

@@ -340,9 +340,16 @@ ln -s  ../local/libexec/java.wrapper /usr/bin/java
 sinfo "Setting cables-related and /root permissions"
 chmod 710 /home/anon{,/persist{,/security{,/cable},/mail,/cables}}
 chmod -R go= /root
+
 # (#431920)
 chmod go=u-w /var/log/wimax
 
+# (#444734)
+chown root:polkitd /etc/polkit-1/rules.d
+chmod 750          /etc/polkit-1/rules.d
+chown root:root    {/etc,/usr/share}/polkit-1/rules.d/* /usr/share/polkit-1/rules.d
+chmod 644          {/etc,/usr/share}/polkit-1/rules.d/*
+
 
 sinfo "Removing invalid symlinks, dirs and files"
 find  /usr/i686-pc-linux-gnu -xtype l -delete