hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Aug 27 09:06:42 PDT 2007


 hald/hald_dbus.c                               |    4 
 hald/linux/addons/addon-cpufreq.c              |    2 
 hald/linux/addons/addon-dell-backlight.cpp     |    2 
 hald/linux/addons/addon-macbook-backlight.c    |    2 
 hald/linux/addons/addon-macbookpro-backlight.c |   10 -
 hald/linux/addons/addon-omap-backlight.c       |    2 
 policy/hal-device-file.policy                  |  150 ++++++++----------
 policy/hal-killswitch.policy                   |   42 ++---
 policy/hal-lock.policy                         |   24 +-
 policy/hal-power.policy                        |  204 ++++++++++++-------------
 policy/hal-storage.policy                      |   96 +++++------
 tools/hal-acl-tool.c                           |    2 
 tools/hal-luks-setup                           |    2 
 tools/hal-luks-teardown                        |    2 
 tools/hal-storage-mount.c                      |   11 -
 tools/hal-storage-shared.c                     |    4 
 tools/hal-system-killswitch-get-power          |    2 
 tools/hal-system-killswitch-set-power          |    2 
 tools/hal-system-lcd-get-brightness            |    2 
 tools/hal-system-lcd-set-brightness            |    2 
 tools/hal-system-power-hibernate               |    2 
 tools/hal-system-power-reboot                  |    4 
 tools/hal-system-power-set-power-save          |    2 
 tools/hal-system-power-shutdown                |    4 
 tools/hal-system-power-suspend                 |    2 
 tools/hal-system-power-suspend-hybrid          |    2 
 26 files changed, 278 insertions(+), 305 deletions(-)

New commits:
diff-tree 9aa4c3acde9e4d37fb5d2f9c39a76fec568111c2 (from cd0d218accc1e1f665069028566c4d949c19f73c)
Author: David Zeuthen <davidz at redhat.com>
Date:   Mon Aug 27 12:01:34 2007 -0400

    update to work with PolicyKit HEAD

diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 95e803c..764da50 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -2055,7 +2055,7 @@ device_acquire_interface_lock (DBusConne
 	}
 
         if (!local_interface) {
-                if (!access_check_caller_have_access_to_device (ci_tracker, d, "hal-lock", sender, NULL)) {
+                if (!access_check_caller_have_access_to_device (ci_tracker, d, "org.freedesktop.hal.lock", sender, NULL)) {
                         raise_permission_denied (connection, message, "AcquireInterfaceLock: no access to device");
                         return DBUS_HANDLER_RESULT_HANDLED;
                 }
@@ -5412,7 +5412,7 @@ validate_lock_for_device (HalDeviceStore
                                    holders[m], locked_interfaces[n], hal_device_get_udi (device)));
 
                         if (!access_check_caller_have_access_to_device (
-                                    ci_tracker, device, "hal-lock", holders[m], NULL)) {
+                                    ci_tracker, device, "org.freedesktop.hal.lock", holders[m], NULL)) {
                                 HAL_INFO (("Kicking out lock holder '%s' on interface '%s' on udi '%s' "
                                            "as he no longer has access to the device",
                                            holders[m], locked_interfaces[n], hal_device_get_udi (device)));
diff --git a/hald/linux/addons/addon-cpufreq.c b/hald/linux/addons/addon-cpufreq.c
index b10edf9..f9690e1 100644
--- a/hald/linux/addons/addon-cpufreq.c
+++ b/hald/linux/addons/addon-cpufreq.c
@@ -40,7 +40,7 @@
 #include "../../logger.h"
 
 #define MAX_LINE_SIZE				255
-#define CPUFREQ_POLKIT_PRIVILEGE		"hal-power-cpufreq"
+#define CPUFREQ_POLKIT_PRIVILEGE		"org.freedesktop.hal.power-management.cpufreq"
 #define DBUS_INTERFACE				"org.freedesktop.Hal.Device.CPUFreq"
 
 #define CPUFREQ_ERROR_GENERAL			"GeneralError"
diff --git a/hald/linux/addons/addon-dell-backlight.cpp b/hald/linux/addons/addon-dell-backlight.cpp
index 3116dfa..c2e485c 100644
--- a/hald/linux/addons/addon-dell-backlight.cpp
+++ b/hald/linux/addons/addon-dell-backlight.cpp
@@ -179,7 +179,7 @@ filter_function (DBusConnection *connect
 	dbus_bool_t AC;
 	dbus_error_init (&err);
 
-        if (!check_priv (connection, message, dbus_message_get_path (message), "hal-power-lcd-panel")) {
+        if (!check_priv (connection, message, dbus_message_get_path (message), "org.freedesktop.hal.power-management.lcd-panel")) {
                 return DBUS_HANDLER_RESULT_HANDLED;
         }
 
diff --git a/hald/linux/addons/addon-macbook-backlight.c b/hald/linux/addons/addon-macbook-backlight.c
index 7cf8174..5a14fd8 100644
--- a/hald/linux/addons/addon-macbook-backlight.c
+++ b/hald/linux/addons/addon-macbook-backlight.c
@@ -255,7 +255,7 @@ filter_function (DBusConnection * connec
 	int level;
 	int ret;
 
-        if (!check_priv (connection, message, dbus_message_get_path (message), "hal-power-lcd-panel")) {
+        if (!check_priv (connection, message, dbus_message_get_path (message), "org.freedesktop.hal.power-management.lcd-panel")) {
                 return DBUS_HANDLER_RESULT_HANDLED;
         }
 
diff --git a/hald/linux/addons/addon-macbookpro-backlight.c b/hald/linux/addons/addon-macbookpro-backlight.c
index 136b5e4..e6521e0 100644
--- a/hald/linux/addons/addon-macbookpro-backlight.c
+++ b/hald/linux/addons/addon-macbookpro-backlight.c
@@ -295,7 +295,7 @@ filter_function (DBusConnection *connect
 					 "SetBrightness")) {
 		int brightness;
 
-                if (!check_priv (connection, message, udi, "hal-power-lcd-panel"))
+                if (!check_priv (connection, message, udi, "org.freedesktop.hal.power-management.lcd-panel"))
                         goto error;
 
 		dbus_error_init (&err);
@@ -332,7 +332,7 @@ filter_function (DBusConnection *connect
 						"GetBrightness")) {
 		int brightness;
 
-                if (!check_priv (connection, message, udi, "hal-power-lcd-panel"))
+                if (!check_priv (connection, message, udi, "org.freedesktop.hal.power-management.lcd-panel"))
                         goto error;
 
 		dbus_error_init (&err);
@@ -363,7 +363,7 @@ filter_function (DBusConnection *connect
 						"GetBrightness")) {
 		int brightness[2];
 
-                if (!check_priv (connection, message, udi, "hal-power-light-sensor"))
+                if (!check_priv (connection, message, udi, "org.freedesktop.hal.power-management.light-sensor"))
                         goto error;
 
 		brightness[0] = read_light_sensor (FALSE); /* right */
@@ -390,7 +390,7 @@ filter_function (DBusConnection *connect
 						"org.freedesktop.Hal.Device.KeyboardBacklight", 
 						"GetBrightness")) {
 
-                if (!check_priv (connection, message, udi, "hal-power-keyboard-backlight"))
+                if (!check_priv (connection, message, udi, "org.freedesktop.hal.power-management.keyboard-backlight"))
                         goto error;
 
 		/* I can't get this working so just cache last SetBrightness value :-/ */
@@ -435,7 +435,7 @@ filter_function (DBusConnection *connect
 						"SetBrightness")) {
 		int brightness;
 
-                if (!check_priv (connection, message, udi, "hal-power-keyboard-backlight"))
+                if (!check_priv (connection, message, udi, "org.freedesktop.hal.power-management.keyboard-backlight"))
                         goto error;
 
 		dbus_error_init (&err);
diff --git a/hald/linux/addons/addon-omap-backlight.c b/hald/linux/addons/addon-omap-backlight.c
index 6809864..95c1113 100644
--- a/hald/linux/addons/addon-omap-backlight.c
+++ b/hald/linux/addons/addon-omap-backlight.c
@@ -182,7 +182,7 @@ filter_function (DBusConnection *connect
 	DBusError err;
 	DBusMessage *reply;
 
-        if (!check_priv (connection, message, dbus_message_get_path (message), "hal-power-lcd-panel")) {
+        if (!check_priv (connection, message, dbus_message_get_path (message), "org.freedesktop.hal.power-management.lcd-panel")) {
                 return DBUS_HANDLER_RESULT_HANDLED;
         }
 
diff --git a/policy/hal-device-file.policy b/policy/hal-device-file.policy
index e3289b4..d1318b6 100644
--- a/policy/hal-device-file.policy
+++ b/policy/hal-device-file.policy
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE policyconfig PUBLIC
  "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
@@ -11,87 +12,80 @@ HAL is licensed to you under your choice
 License Version 2.1, or the GNU General Public License version 2. Some
 individual source files may be under the GPL only. See COPYING for
 details.
-
-NOTE: If you make changes to this file, make sure to validate the file
-using the polkit-policy-file-validate(1) tool. Changes made to this
-file are instantly applied.
 -->
 
 <policyconfig>
-  <group id="hal-device-file">
-    <description>Raw device access</description>
 
-    <policy id="hal-device-file-sound">
-      <description>Directly access sound devices</description>
-      <message>System policy prevents access to the sound devices</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-device-file-video4linux">
-      <description>Directly access video capture devices</description>
-      <message>System policy prevents access to video capture devices</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-device-file-cdrom">
-      <description>Directly access optical drives</description>
-      <message>System policy prevents access to optical drives</message>
-      <defaults>
-        <allow_inactive>yes</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-device-file-dvb">
-      <description>Directly access DVB devices</description>
-      <message>System policy prevents access to DVB devices</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-device-file-camera">
-      <description>Directly access digital cameras</description>
-      <message>System policy prevents access to digital cameras</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-device-file-scanner">
-      <description>Directly access scanners</description>
-      <message>System policy prevents access to scanners</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-device-file-ieee1394-iidc">
-      <description>Directly access Firewire IIDC devices</description>
-      <message>System policy prevents access to Firewire IIDC devices</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-device-file-ieee1394-avc">
-      <description>Directly access Firewire AVC devices</description>
-      <message>System policy prevents access to Firewire AVC devices</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
+  <action id="org.freedesktop.hal.device-access.sound">
+    <description>Directly access sound devices</description>
+    <message>System policy prevents access to the sound devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.device-access.video4linux">
+    <description>Directly access video capture devices</description>
+    <message>System policy prevents access to video capture devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.device-access.cdrom">
+    <description>Directly access optical drives</description>
+    <message>System policy prevents access to optical drives</message>
+    <defaults>
+      <allow_inactive>yes</allow_inactive>
+      <allow_active>yes</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>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.device-access.camera">
+    <description>Directly access digital cameras</description>
+    <message>System policy prevents access to digital cameras</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.device-access.scanner">
+    <description>Directly access scanners</description>
+    <message>System policy prevents access to scanners</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.device-access.ieee1394-iidc">
+    <description>Directly access Firewire IIDC devices</description>
+    <message>System policy prevents access to Firewire IIDC devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.device-access.ieee1394-avc">
+    <description>Directly access Firewire AVC devices</description>
+    <message>System policy prevents access to Firewire AVC devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
 
-  </group>
 </policyconfig>
diff --git a/policy/hal-killswitch.policy b/policy/hal-killswitch.policy
index c658cdc..dce0339 100644
--- a/policy/hal-killswitch.policy
+++ b/policy/hal-killswitch.policy
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE policyconfig PUBLIC
  "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
@@ -11,33 +12,26 @@ HAL is licensed to you under your choice
 License Version 2.1, or the GNU General Public License version 2. Some
 individual source files may be under the GPL only. See COPYING for
 details.
-
-NOTE: If you make changes to this file, make sure to validate the file
-using the polkit-policy-file-validate(1) tool. Changes made to this
-file are instantly applied.
 -->
 
 <policyconfig>
-  <group id="hal-killswitch">
-    <description>Radio Killswitches</description>
 
-    <policy id="hal-killswitch-bluetooth">
-      <description>Turn Bluetooth radio On/Off</description>
-      <message>System policy prevents turning the Bluetooth radio On/Off</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-killswitch-wlan">
-      <description>Turn WLAN radio On/Off</description>
-      <message>System policy prevents turning the WLAN radio On/Off</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
+  <action id="org.freedesktop.hal.killswitch.bluetooth">
+    <description>Turn Bluetooth radio On/Off</description>
+    <message>System policy prevents turning the Bluetooth radio On/Off</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.killswitch.wlan">
+    <description>Turn WLAN radio On/Off</description>
+    <message>System policy prevents turning the WLAN radio On/Off</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
 
-  </group>
 </policyconfig>
diff --git a/policy/hal-lock.policy b/policy/hal-lock.policy
index 161d30d..6789a4a 100644
--- a/policy/hal-lock.policy
+++ b/policy/hal-lock.policy
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE policyconfig PUBLIC
  "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
@@ -11,24 +12,17 @@ HAL is licensed to you under your choice
 License Version 2.1, or the GNU General Public License version 2. Some
 individual source files may be under the GPL only. See COPYING for
 details.
-
-NOTE: If you make changes to this file, make sure to validate the file
-using the polkit-policy-file-validate(1) tool. Changes made to this
-file are instantly applied.
 -->
 
 <policyconfig>
-  <group id="hal-lock">
-    <description>Locking of devices</description>
 
-    <policy id="hal-lock">
-      <description>Acquire locks on devices</description>
-      <message>System policy prevents locking devices</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
+  <action id="org.freedesktop.hal.lock">
+    <description>Acquire locks on devices</description>
+    <message>System policy prevents locking devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
 
-  </group>
 </policyconfig>
diff --git a/policy/hal-power.policy b/policy/hal-power.policy
index ffc1a7f..f0ee7fd 100644
--- a/policy/hal-power.policy
+++ b/policy/hal-power.policy
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE policyconfig PUBLIC
  "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
@@ -11,114 +12,107 @@ HAL is licensed to you under your choice
 License Version 2.1, or the GNU General Public License version 2. Some
 individual source files may be under the GPL only. See COPYING for
 details.
-
-NOTE: If you make changes to this file, make sure to validate the file
-using the polkit-policy-file-validate(1) tool. Changes made to this
-file are instantly applied.
 -->
 
 <policyconfig>
-  <group id="hal-power">
-    <description>Power Management</description>
 
-    <policy id="hal-power-shutdown">
-      <description>Shut down the system</description>
-      <message>System policy prevents shutting down the system</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-shutdown-multiple-sessions">
-      <description>Shut down the system when multiple users are logged in</description>
-      <message>System policy prevents shutting down the system while multiple users are logged in</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>auth_admin</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-reboot">
-      <description>Reboot the system</description>
-      <message>System policy prevents rebooting the system</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-reboot-multiple-sessions">
-      <description>Reboot the system when multiple users are logged in</description>
-      <message>System policy prevents rebooting the system while multiple users are logged in</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>auth_admin</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-set-powersave">
-      <description>Configure to system to prefer power savings</description>
-      <message>System policy prevents enabling power savings</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-suspend">
-      <description>Suspend the system</description>
-      <message>System policy prevents suspending the system</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-hibernate">
-      <description>Hibernate the system</description>
-      <message>System policy prevents hibernating the system</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-cpufreq">
-      <description>Configure CPU frequency scaling</description>
-      <message>System policy prevents CPU frequency scaling to be configured</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-lcd-panel">
-      <description>Set laptop panel brightness</description>
-      <message>System policy prevents adjusting the laptop panel brightness</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-light-sensor">
-      <description>Detect ambient light using light sensor</description>
-      <message>System policy prevents accessing the ambient light sensor</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-power-keyboard-backlight">
-      <description>Set keyboard backlight</description>
-      <message>System policy prevents adjusting the keyboard backlight</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
+  <action id="org.freedesktop.hal.power-management.shutdown">
+    <description>Shut down the system</description>
+    <message>System policy prevents shutting down the system</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.shutdown-multiple-sessions">
+    <description>Shut down the system when multiple users are logged in</description>
+    <message>System policy prevents shutting down the system while multiple users are logged in</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>auth_admin</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.reboot">
+    <description>Reboot the system</description>
+    <message>System policy prevents rebooting the system</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.reboot-multiple-sessions">
+    <description>Reboot the system when multiple users are logged in</description>
+    <message>System policy prevents rebooting the system while multiple users are logged in</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>auth_admin</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.set-powersave">
+    <description>Configure to system to prefer power savings</description>
+    <message>System policy prevents enabling power savings</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.suspend">
+    <description>Suspend the system</description>
+    <message>System policy prevents suspending the system</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.hibernate">
+    <description>Hibernate the system</description>
+    <message>System policy prevents hibernating the system</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.cpufreq">
+    <description>Configure CPU frequency scaling</description>
+    <message>System policy prevents CPU frequency scaling to be configured</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.lcd-panel">
+    <description>Set laptop panel brightness</description>
+    <message>System policy prevents adjusting the laptop panel brightness</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.light-sensor">
+    <description>Detect ambient light using light sensor</description>
+    <message>System policy prevents accessing the ambient light sensor</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.power-management.keyboard-backlight">
+    <description>Set keyboard backlight</description>
+    <message>System policy prevents adjusting the keyboard backlight</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
 
-  </group>
 </policyconfig>
diff --git a/policy/hal-storage.policy b/policy/hal-storage.policy
index 8f2e54c..ff729c8 100644
--- a/policy/hal-storage.policy
+++ b/policy/hal-storage.policy
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE policyconfig PUBLIC
  "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
@@ -11,60 +12,53 @@ HAL is licensed to you under your choice
 License Version 2.1, or the GNU General Public License version 2. Some
 individual source files may be under the GPL only. See COPYING for
 details.
-
-NOTE: If you make changes to this file, make sure to validate the file
-using the polkit-policy-file-validate(1) tool. Changes made to this
-file are instantly applied.
 -->
 
 <policyconfig>
-  <group id="hal-storage">
-    <description>Storage Drives and Media</description>
 
-    <policy id="hal-storage-mount-fixed">
-      <description>Mount file systems from internal drives.</description>
-      <message>System policy prevents mounting internal media</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>auth_admin_keep_always</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-storage-mount-removable">
-      <description>Mount file systems from removable drives.</description>
-      <message>System policy prevents mounting removable media</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-storage-unmount-others">
-      <description>Unmount file systems mounted by other users.</description>
-      <message>System policy prevents unmounting media mounted by other users</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>auth_admin_keep_always</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-storage-eject">
-      <description>Eject removable media.</description>
-      <message>System policy prevents ejecting removable media</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
-
-    <policy id="hal-storage-crypto-setup">
-      <description>Set up decryption for encrypted storage devices.</description>
-      <message>System policy prevents accessing encrypted storage devices</message>
-      <defaults>
-        <allow_inactive>no</allow_inactive>
-        <allow_active>yes</allow_active>
-      </defaults>
-    </policy>
+  <action id="org.freedesktop.hal.storage.mount-fixed">
+    <description>Mount file systems from internal drives.</description>
+    <message>System policy prevents mounting internal media</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>auth_admin_keep_always</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.storage.mount-removable">
+    <description>Mount file systems from removable drives.</description>
+    <message>System policy prevents mounting removable media</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.storage.unmount-others">
+    <description>Unmount file systems mounted by other users.</description>
+    <message>System policy prevents unmounting media mounted by other users</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>auth_admin_keep_always</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.storage.eject">
+    <description>Eject removable media.</description>
+    <message>System policy prevents ejecting removable media</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+  
+  <action id="org.freedesktop.hal.storage.crypto-setup">
+    <description>Set up decryption for encrypted storage devices.</description>
+    <message>System policy prevents accessing encrypted storage devices</message>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
 
-  </group>
 </policyconfig>
diff --git a/tools/hal-acl-tool.c b/tools/hal-acl-tool.c
index ef4106e..7a6a942 100644
--- a/tools/hal-acl-tool.c
+++ b/tools/hal-acl-tool.c
@@ -774,7 +774,7 @@ acl_device_added_visitor (const char *se
                 /* TODO: FIXME: polkit_session_set_ck_remote_host (pk_session, );*/ 
 
                 pk_action = polkit_action_new();
-                priv_name = g_strdup_printf ("hal-device-file-%s", afd->type);
+                priv_name = g_strdup_printf ("org.freedesktop.hal.device-access.%s", afd->type);
                 polkit_action_set_action_id (pk_action, priv_name);
                 g_free (priv_name);
 
diff --git a/tools/hal-luks-setup b/tools/hal-luks-setup
index 91b0cb8..96112ec 100755
--- a/tools/hal-luks-setup
+++ b/tools/hal-luks-setup
@@ -39,6 +39,6 @@ if [ -n "$HAL_METHOD_INVOKED_BY_SYSTEMBU
     fi
 fi
 
-hal_check_priv hal-storage-crypto-setup
+hal_check_priv org.freedesktop.hal.storage.crypto-setup
 
 hal_exec_backend
diff --git a/tools/hal-luks-teardown b/tools/hal-luks-teardown
index 332a16d..2b82503 100755
--- a/tools/hal-luks-teardown
+++ b/tools/hal-luks-teardown
@@ -41,6 +41,6 @@ if [ -n "$HAL_METHOD_INVOKED_BY_SYSTEMBU
 fi
 
 # TODO: this is a little sketchy; we should check for hal-storage-crypto-teardown-others
-hal_check_priv hal-storage-crypto-setup
+hal_check_priv org.freedesktop.hal.storage.crypto-setup
 
 hal_exec_backend
diff --git a/tools/hal-storage-mount.c b/tools/hal-storage-mount.c
index df8103a..ae14181 100644
--- a/tools/hal-storage-mount.c
+++ b/tools/hal-storage-mount.c
@@ -765,17 +765,20 @@ handle_mount (LibHalContext *hal_ctx, 
 
 	if (pol_is_fixed) {
 		if (pol_change_uid) {
-			action = "hal-storage-mount-fixed-extra-options";
+			action = NULL; /* "hal-storage-mount-fixed-extra-options"; TODO: rethink */
 		} else {
-			action = "hal-storage-mount-fixed";
+			action = "org.freedesktop.hal.storage.mount-fixed";
 		}
 	} else {
 		if (pol_change_uid) {
-			action = "hal-storage-mount-removable-extra-options"; /* TODO: rethink "extra-options" */
+			action = NULL; /* "hal-storage-mount-removable-extra-options"; TODO: rethink "extra-options" */
 		} else {
-			action = "hal-storage-mount-removable";
+			action = "org.freedesktop.hal.storage.mount-removable";
 		}
 	}
+        if (action == NULL) {
+                unknown_error ("TODO: have to rethink extra options");
+        }
 
 #ifdef DEBUG
 	printf ("using action %s for uid %s, system_bus_connection %s\n", action, invoked_by_uid, 
diff --git a/tools/hal-storage-shared.c b/tools/hal-storage-shared.c
index 005abd4..19be0c9 100644
--- a/tools/hal-storage-shared.c
+++ b/tools/hal-storage-shared.c
@@ -419,7 +419,7 @@ line_found:
 	 * We allow uid 0 to actually ensure that Unmount(options=["lazy"], "/dev/blah") works from addon-storage.
 	 */
 	if ((strcmp (invoked_by_uid, "0") != 0) && mounted_by_other_uid) {
-                const char *action = "hal-storage-unmount-others";
+                const char *action = "org.freedesktop.hal.storage.unmount-others";
 #ifdef HAVE_POLKIT
                 if (invoked_by_syscon_name != NULL) {
                         char *polkit_result;
@@ -596,7 +596,7 @@ try_open_excl_again:
 #ifdef HAVE_POLKIT
         if (invoked_by_syscon_name != NULL) {
                 char *polkit_result;
-                const char *action = "hal-storage-eject";
+                const char *action = "org.freedesktop.hal.storage.eject";
                 dbus_error_init (&error);
                 polkit_result = libhal_device_is_caller_privileged (hal_ctx,
                                                                     udi,
diff --git a/tools/hal-system-killswitch-get-power b/tools/hal-system-killswitch-get-power
index 8f46226..7f99a8f 100755
--- a/tools/hal-system-killswitch-get-power
+++ b/tools/hal-system-killswitch-get-power
@@ -17,5 +17,5 @@ if [ -z "$HAL_PROP_KILLSWITCH_ACCESS_MET
 	exit 1
 fi
 
-hal_check_priv hal-killswitch-$HAL_PROP_KILLSWITCH_TYPE
+hal_check_priv org.freedesktop.hal.killswitch.$HAL_PROP_KILLSWITCH_TYPE
 hal_exec_backend
diff --git a/tools/hal-system-killswitch-set-power b/tools/hal-system-killswitch-set-power
index cc65c81..33d8c65 100755
--- a/tools/hal-system-killswitch-set-power
+++ b/tools/hal-system-killswitch-set-power
@@ -21,5 +21,5 @@ fi
 read value
 export value
 
-hal_check_priv hal-killswitch-$HAL_PROP_KILLSWITCH_TYPE
+hal_check_priv org.freedesktop.hal.killswitch.$HAL_PROP_KILLSWITCH_TYPE
 hal_exec_backend
diff --git a/tools/hal-system-lcd-get-brightness b/tools/hal-system-lcd-get-brightness
index afa92d2..76dbd35 100755
--- a/tools/hal-system-lcd-get-brightness
+++ b/tools/hal-system-lcd-get-brightness
@@ -17,5 +17,5 @@ if [ -z "$HAL_PROP_LAPTOP_PANEL_ACCESS_M
 	exit 1
 fi
 
-hal_check_priv hal-power-lcd-panel
+hal_check_priv org.freedesktop.hal.power-management.lcd-panel
 hal_exec_backend
diff --git a/tools/hal-system-lcd-set-brightness b/tools/hal-system-lcd-set-brightness
index 94c324b..aa7ceb4 100755
--- a/tools/hal-system-lcd-set-brightness
+++ b/tools/hal-system-lcd-set-brightness
@@ -30,5 +30,5 @@ fi
 
 export value
 
-hal_check_priv hal-power-lcd-panel
+hal_check_priv org.freedesktop.hal.power-management.lcd-panel
 hal_exec_backend
diff --git a/tools/hal-system-power-hibernate b/tools/hal-system-power-hibernate
index c1d81db..d805764 100755
--- a/tools/hal-system-power-hibernate
+++ b/tools/hal-system-power-hibernate
@@ -2,5 +2,5 @@
 
 . hal-functions
 
-hal_check_priv hal-power-hibernate
+hal_check_priv org.freedesktop.hal.power-management.hibernate
 hal_exec_backend
diff --git a/tools/hal-system-power-reboot b/tools/hal-system-power-reboot
index 5b551ad..a62b1a3 100755
--- a/tools/hal-system-power-reboot
+++ b/tools/hal-system-power-reboot
@@ -3,9 +3,9 @@
 . hal-functions
 
 if [ "$CK_NUM_SESSIONS" -gt "1" ] ; then
-    hal_check_priv hal-power-reboot-multiple-sessions
+    hal_check_priv org.freedesktop.hal.power-management.reboot-multiple-sessions
 else
-    hal_check_priv hal-power-reboot
+    hal_check_priv org.freedesktop.hal.power-management.reboot
 fi
 
 hal_exec_backend
diff --git a/tools/hal-system-power-set-power-save b/tools/hal-system-power-set-power-save
index 3cd88dc..bdc4962 100755
--- a/tools/hal-system-power-set-power-save
+++ b/tools/hal-system-power-set-power-save
@@ -4,7 +4,7 @@
 
 read value
 
-hal_check_priv hal-power-set-powersave
+hal_check_priv org.freedesktop.hal.power-management.set-powersave
 hal_call_backend $value
 if [ "$?" = "0" ]; then
     hal-set-property --udi $UDI --key "power_management.is_powersave_set" --bool "$value"
diff --git a/tools/hal-system-power-shutdown b/tools/hal-system-power-shutdown
index 6016214..cf0b729 100755
--- a/tools/hal-system-power-shutdown
+++ b/tools/hal-system-power-shutdown
@@ -3,9 +3,9 @@
 . hal-functions
 
 if [ "$CK_NUM_SESSIONS" -gt "1" ] ; then
-    hal_check_priv hal-power-shutdown-multiple-sessions
+    hal_check_priv org.freedesktop.hal.power-management.shutdown-multiple-sessions
 else
-    hal_check_priv hal-power-shutdown
+    hal_check_priv org.freedesktop.hal.power-management.shutdown
 fi
 
 hal_exec_backend
diff --git a/tools/hal-system-power-suspend b/tools/hal-system-power-suspend
index 43f7346..0b59cb1 100755
--- a/tools/hal-system-power-suspend
+++ b/tools/hal-system-power-suspend
@@ -2,5 +2,5 @@
 
 . hal-functions
 
-hal_check_priv hal-power-suspend
+hal_check_priv org.freedesktop.hal.power-management.suspend
 hal_exec_backend
diff --git a/tools/hal-system-power-suspend-hybrid b/tools/hal-system-power-suspend-hybrid
index 43f7346..0b59cb1 100755
--- a/tools/hal-system-power-suspend-hybrid
+++ b/tools/hal-system-power-suspend-hybrid
@@ -2,5 +2,5 @@
 
 . hal-functions
 
-hal_check_priv hal-power-suspend
+hal_check_priv org.freedesktop.hal.power-management.suspend
 hal_exec_backend


More information about the hal-commit mailing list