add an example dbus_policy.conf
authorHelmut Grohne <helmut@subdivi.de>
Sat, 6 Jul 2013 11:42:08 +0000 (13:42 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Sat, 6 Jul 2013 11:42:08 +0000 (13:42 +0200)
This can be used when running onoff on the system bus. It should be
placed as /etc/dbus-1/system.d/onoff.conf then.

dbus_policy.conf [new file with mode: 0644]

diff --git a/dbus_policy.conf b/dbus_policy.conf
new file mode 100644 (file)
index 0000000..cf0e427
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+  <!-- Assuming root runs onoff. Using fewer privileges would be a good idea
+       though. -->
+  <policy user="root">
+    <allow own="de.subdivi.onoff0"/>
+    <allow send_destination="de.subdivi.onoff0"/>
+  </policy>
+
+  <!-- Allow everyone to talk to onoff. Might not be necessary. -->
+  <policy context="default">
+    <allow send_destination="de.subdivi.onoff0"/>
+  </policy>
+</busconfig>
+<!-- vim: syntax=xml
+  -->