summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-11-13 16:18:20 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-11-13 16:18:20 +0000
commita40937598985b3f25f6078c9407bf9b682bf6f56 (patch)
treebf4bf8ef9898dce88c7641453afb7be7e0dd25e1
parentdca3a7c10e38214bf9b5ae7afc2677980ca408e9 (diff)
Establish well known name for input service
-rw-r--r--input/Makefile.am8
-rw-r--r--input/bluetooth-input.conf21
-rw-r--r--input/input-service.c2
3 files changed, 30 insertions, 1 deletions
diff --git a/input/Makefile.am b/input/Makefile.am
index c23df9ba..b578645c 100644
--- a/input/Makefile.am
+++ b/input/Makefile.am
@@ -1,4 +1,10 @@
+if CONFIGFILES
+dbusdir = $(sysconfdir)/dbus-1/system.d
+
+dbus_DATA = bluetooth-input.conf
+endif
+
noinst_PROGRAMS = bt.inputd
bt_inputd_SOURCES = main.c input-service.h input-service.c
@@ -9,4 +15,6 @@ AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@
INCLUDES = -I$(top_srcdir)/common
+EXTRA_DIST = bluetooth-input.conf
+
MAINTAINERCLEANFILES = Makefile.in
diff --git a/input/bluetooth-input.conf b/input/bluetooth-input.conf
new file mode 100644
index 00000000..90643f74
--- /dev/null
+++ b/input/bluetooth-input.conf
@@ -0,0 +1,21 @@
+<!-- This configuration file specifies the required security policies
+ for Bluetooth input service to work. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="org.bluez.input"/>
+ </policy>
+
+ <policy at_console="true">
+ <allow send_destination="org.bluez.Input"/>
+ <allow receive_sender="org.bluez.Input"/>
+
+ <allow send_path="/org/bluez/input"/>
+ </policy>
+
+</busconfig>
diff --git a/input/input-service.c b/input/input-service.c
index a64b1c25..d76ef74b 100644
--- a/input/input-service.c
+++ b/input/input-service.c
@@ -144,7 +144,7 @@ int input_dbus_init(void)
const char *description = "A service for input devices";
const char *input_path = INPUT_PATH;
- connection = init_dbus(NULL, NULL, NULL);
+ connection = init_dbus("org.bluez.input", NULL, NULL);
if (!connection)
return -1;