summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hald/hald_dbus.c4
-rw-r--r--hald/linux/addons/addon-cpufreq.c2
-rw-r--r--hald/linux/addons/addon-dell-backlight.cpp2
-rw-r--r--hald/linux/addons/addon-macbook-backlight.c2
-rw-r--r--hald/linux/addons/addon-macbookpro-backlight.c10
-rw-r--r--hald/linux/addons/addon-omap-backlight.c2
-rw-r--r--policy/hal-device-file.policy150
-rw-r--r--policy/hal-killswitch.policy42
-rw-r--r--policy/hal-lock.policy24
-rw-r--r--policy/hal-power.policy204
-rw-r--r--policy/hal-storage.policy96
-rw-r--r--tools/hal-acl-tool.c2
-rwxr-xr-xtools/hal-luks-setup2
-rwxr-xr-xtools/hal-luks-teardown2
-rw-r--r--tools/hal-storage-mount.c11
-rw-r--r--tools/hal-storage-shared.c4
-rwxr-xr-xtools/hal-system-killswitch-get-power2
-rwxr-xr-xtools/hal-system-killswitch-set-power2
-rwxr-xr-xtools/hal-system-lcd-get-brightness2
-rwxr-xr-xtools/hal-system-lcd-set-brightness2
-rwxr-xr-xtools/hal-system-power-hibernate2
-rwxr-xr-xtools/hal-system-power-reboot4
-rwxr-xr-xtools/hal-system-power-set-power-save2
-rwxr-xr-xtools/hal-system-power-shutdown4
-rwxr-xr-xtools/hal-system-power-suspend2
-rwxr-xr-xtools/hal-system-power-suspend-hybrid2
26 files changed, 278 insertions, 305 deletions
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 95e803cd..764da50f 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -2055,7 +2055,7 @@ device_acquire_interface_lock (DBusConnection *connection, DBusMessage *message,
}
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 *store,
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 b10edf9b..f9690e13 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 3116dfa3..c2e485c2 100644
--- a/hald/linux/addons/addon-dell-backlight.cpp
+++ b/hald/linux/addons/addon-dell-backlight.cpp
@@ -179,7 +179,7 @@ filter_function (DBusConnection *connection, DBusMessage *message, void *userdat
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 7cf81746..5a14fd81 100644
--- a/hald/linux/addons/addon-macbook-backlight.c
+++ b/hald/linux/addons/addon-macbook-backlight.c
@@ -255,7 +255,7 @@ filter_function (DBusConnection * connection, DBusMessage * message, void *userd
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 136b5e4e..e6521e09 100644
--- a/hald/linux/addons/addon-macbookpro-backlight.c
+++ b/hald/linux/addons/addon-macbookpro-backlight.c
@@ -295,7 +295,7 @@ filter_function (DBusConnection *connection, DBusMessage *message, void *userdat
"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 *connection, DBusMessage *message, void *userdat
"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 *connection, DBusMessage *message, void *userdat
"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 *connection, DBusMessage *message, void *userdat
"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 *connection, DBusMessage *message, void *userdat
"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 6809864b..95c11138 100644
--- a/hald/linux/addons/addon-omap-backlight.c
+++ b/hald/linux/addons/addon-omap-backlight.c
@@ -182,7 +182,7 @@ filter_function (DBusConnection *connection, DBusMessage *message, void *userdat
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 e3289b40..d1318b63 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 of the the Academic Free
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 c658cdc3..dce0339d 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 of the the Academic Free
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 161d30d4..6789a4a4 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 of the the Academic Free
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 ffc1a7f9..f0ee7fdf 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 of the the Academic Free
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 8f2e54c5..ff729c8d 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 of the the Academic Free
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 ef4106ed..7a6a942c 100644
--- a/tools/hal-acl-tool.c
+++ b/tools/hal-acl-tool.c
@@ -774,7 +774,7 @@ acl_device_added_visitor (const char *seat_id,
/* 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 91b0cb8c..96112ec4 100755
--- a/tools/hal-luks-setup
+++ b/tools/hal-luks-setup
@@ -39,6 +39,6 @@ if [ -n "$HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME" ] ; then
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 332a16d5..2b825037 100755
--- a/tools/hal-luks-teardown
+++ b/tools/hal-luks-teardown
@@ -41,6 +41,6 @@ if [ -n "$HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME" ] ; then
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 df8103a9..ae14181f 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 005abd4d..19be0c94 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 8f462261..7f99a8f4 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_METHOD" ]; then
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 cc65c816..33d8c65a 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 afa92d2e..76dbd353 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_METHOD" -a -z "$HAL_PROP_LINUX_SYSFS_PATH
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 94c324b4..aa7ceb4e 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 c1d81db4..d8057647 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 5b551ada..a62b1a3a 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 3cd88dcd..bdc4962c 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 60162143..cf0b7292 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 43f73465..0b59cb12 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 43f73465..0b59cb12 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