hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Thu Nov 27 04:44:45 PST 2008


 fdi/policy/10osvendor/20-acl-management.fdi     |    9 +++++++++
 policy/org.freedesktop.hal.device-access.policy |    9 +++++++++
 2 files changed, 18 insertions(+)

New commits:
commit e72cb4437700b4b34ac5c6de0e30dff8bb0ed89e
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Thu Nov 27 13:42:24 2008 +0100

    add ACL support to removable block devices
    
    This adds support for adding ACLs to removable block devices (such as
    USB keys) on insertion. This is useful for allowing users to run mkfs
    or fsck on their USB keys.
    
    Please note that the patch does *not* enable it by default, that's up
    to distros or individual users (gnome-polkit-authorization), but it
    provides a standard flip to configure this behaviour.

diff --git a/fdi/policy/10osvendor/20-acl-management.fdi b/fdi/policy/10osvendor/20-acl-management.fdi
index 4b0c616..22f325b 100644
--- a/fdi/policy/10osvendor/20-acl-management.fdi
+++ b/fdi/policy/10osvendor/20-acl-management.fdi
@@ -28,6 +28,15 @@
       <merge key="access_control.type" type="string">video4linux</merge>
     </match>
 
+    <!-- Removable block devices -->
+    <match key="info.capabilities" contains="block">
+      <match key="@block.storage_device:storage.removable" bool="true">
+        <append key="info.capabilities" type="strlist">access_control</append>
+        <merge key="access_control.file" type="copy_property">block.device</merge>
+        <merge key="access_control.type" type="string">removable-block</merge>
+      </match>
+    </match>
+
     <!-- optical drives -->
     <match key="info.capabilities" contains="storage.cdrom">
       <append key="info.capabilities" type="strlist">access_control</append>
diff --git a/policy/org.freedesktop.hal.device-access.policy b/policy/org.freedesktop.hal.device-access.policy
index 3c07e72..5371174 100644
--- a/policy/org.freedesktop.hal.device-access.policy
+++ b/policy/org.freedesktop.hal.device-access.policy
@@ -55,6 +55,15 @@ NOTE: Please keep the actions in alpabetical order
     </defaults>
   </action>
 
+  <action id="org.freedesktop.hal.device-access.removable-block">
+    <description>Directly access removable block devices</description>
+    <message>System policy prevents access to removable block devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>no</allow_active>
+    </defaults>
+  </action>
+
   <action id="org.freedesktop.hal.device-access.dvb">
     <description>Directly access DVB devices</description>
     <message>System policy prevents access to DVB devices</message>


More information about the hal-commit mailing list