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 [moved from src/connman.conf with 90% similarity]
src/connman-polkit.conf [new file with mode: 0644]

index 8424ca8..7165e38 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 a1cfcc2..a540bf1 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 $< $@
similarity index 90%
rename from src/connman.conf
rename to src/connman-dbus.conf
index 55f76d6..b4d4acd 100644 (file)
@@ -10,7 +10,6 @@
         <allow send_destination="org.moblin.connman"/>
     </policy>
     <policy context="default">
-        <!-- use "allow" with enabled PolicyKit support -->
         <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>