Install different D-Bus configuration if PolicyKit is enabled
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 7 Jan 2009 16:37:26 +0000 (17:37 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 7 Jan 2009 16:37:26 +0000 (17:37 +0100)
.gitignore
src/Makefile.am
src/connman-dbus.conf [new file with mode: 0644]
src/connman-polkit.conf [new file with mode: 0644]
src/connman.conf [deleted file]

index 8424ca8e94c94dbcc301a92d63d254fbc64550b2..7165e383e1f79915d3e1ada444d8a1714ca1015e 100644 (file)
@@ -27,6 +27,7 @@ src/version.h
 src/connmand
 src/connman.exp
 src/connman.ver
+src/connman.conf
 src/connman.service
 src/*-connman.rules
 scripts/connman
index a1cfcc2d5952d9bfeef14e9fe48b1160d16e760b..a540bf128dbccdc64de8b1bc7fa148b05b235e76 100644 (file)
@@ -24,7 +24,7 @@ connmand_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=connman.ver
 
 connmand_DEPENDENCIES = connman.ver
 
-CLEANFILES = connman.ver connman.exp 92-connman.rules
+CLEANFILES = connman.ver connman.exp connman.conf 92-connman.rules
 
 statedir = $(localstatedir)/run/connman
 
@@ -42,7 +42,7 @@ AM_CFLAGS = @UDEV_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ \
                                                -DPLUGINDIR=\""$(plugindir)"\"
 INCLUDES = -I$(top_builddir)/include
 
-EXTRA_DIST = $(dbus_DATA) connman.rules
+EXTRA_DIST = connman-dbus.conf connman-polkit.conf connman.rules
 
 MAINTAINERCLEANFILES = Makefile.in
 
@@ -54,5 +54,12 @@ connman.ver: connman.exp
        cat $< | sed -e "s/\(.*\)/\1;/" >> $@
        echo "local: *; };" >> $@
 
+connman.conf: connman-dbus.conf connman-polkit.conf
+if POLKIT
+       cp $(top_srcdir)/src/connman-polkit.conf $@
+else
+       cp $(top_srcdir)/src/connman-dbus.conf $@
+endif
+
 92-connman.rules: connman.rules
        cp $< $@
diff --git a/src/connman-dbus.conf b/src/connman-dbus.conf
new file mode 100644 (file)
index 0000000..b4d4acd
--- /dev/null
@@ -0,0 +1,15 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+    <policy user="root">
+        <allow own="org.moblin.connman"/>
+        <allow send_destination="org.moblin.connman"/>
+        <allow send_interface="org.moblin.connman.Agent"/>
+    </policy>
+    <policy at_console="true">
+        <allow send_destination="org.moblin.connman"/>
+    </policy>
+    <policy context="default">
+        <deny send_destination="org.moblin.connman"/>
+    </policy>
+</busconfig>
diff --git a/src/connman-polkit.conf b/src/connman-polkit.conf
new file mode 100644 (file)
index 0000000..9e44b8b
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+    <policy user="root">
+        <allow own="org.moblin.connman"/>
+        <allow send_interface="org.moblin.connman.Agent"/>
+    </policy>
+    <policy context="default">
+        <allow send_destination="org.moblin.connman"/>
+    </policy>
+</busconfig>
diff --git a/src/connman.conf b/src/connman.conf
deleted file mode 100644 (file)
index 55f76d6..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-    <policy user="root">
-        <allow own="org.moblin.connman"/>
-        <allow send_destination="org.moblin.connman"/>
-        <allow send_interface="org.moblin.connman.Agent"/>
-    </policy>
-    <policy at_console="true">
-        <allow send_destination="org.moblin.connman"/>
-    </policy>
-    <policy context="default">
-        <!-- use "allow" with enabled PolicyKit support -->
-        <deny send_destination="org.moblin.connman"/>
-    </policy>
-</busconfig>