Modify dbus policies based on default deny 15/187615/2
authorWootak Jung <wootak.jung@samsung.com>
Mon, 27 Aug 2018 01:54:42 +0000 (10:54 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 27 Aug 2018 06:24:27 +0000 (15:24 +0900)
Change-Id: I6df07a1032f1d3cd58ea68ae87323f9095143619

bt-api/bt-common.c
bt-oal/bluez_hal/bluetooth-frwk-gap-agent.conf
bt-oal/bluez_hal/src/bt-hal-dbus-common-utils.c
bt-service-adaptation/bluetooth-frwk-service.conf.in

index 8b134c2..d9ab407 100644 (file)
@@ -1304,7 +1304,7 @@ void _bt_unregister_profile(char *path)
 GDBusNodeInfo * _bt_get_gdbus_node(const gchar *xml_data)
 {
        if (bus_id == 0) {
-               char *name = g_strdup_printf("org.bt.frwk%d", getpid());
+               char *name = g_strdup_printf("org.bt.frwk.p%d", getpid());
 
                bus_id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
                                                name,
index d75e874..635b385 100644 (file)
@@ -2,14 +2,20 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
     <policy user="root">
-        <allow send_destination="org.projectx.bt" send_interface="org.bluez.Agent1"/>
-       <allow send_interface="org.bluez.Profile1"/>
+        <!-- service name(org.bt.frwk.p<pid>) is changeable by pid -->
+        <allow own_prefix="org.bt.frwk"/>
+        <allow send_interface="org.bluez.Profile1" send_member="NewConnection"/>
+        <allow send_interface="org.bluez.Profile1" send_member="RequestDisconnection"/>
     </policy>
     <policy group="network_fw">
-        <allow send_destination="org.projectx.bt" send_interface="org.bluez.Agent1"/>
-       <allow send_interface="org.bluez.Profile1"/>
+        <!-- service name(org.bt.frwk.p<pid>) is changeable by pid -->
+        <allow own_prefix="org.bt.frwk"/>
+        <allow send_interface="org.bluez.Profile1" send_member="NewConnection"/>
+        <allow send_interface="org.bluez.Profile1" send_member="RequestDisconnection"/>
     </policy>
     <policy context="default">
-        <check send_destination="org.projectx.bt" send_interface="org.bluez.Agent1" privilege="http://tizen.org/privilege/bluetooth.admin"/>
+        <deny own_prefix="org.bt.frwk"/>
+        <deny send_interface="org.bluez.Profile1" send_member="NewConnection"/>
+        <deny send_interface="org.bluez.Profile1" send_member="RequestDisconnection"/>
     </policy>
 </busconfig>
index 5134b2f..c9a7812 100644 (file)
@@ -1477,7 +1477,7 @@ static void __hal_new_connection_method(GDBusConnection *connection,
 static GDBusNodeInfo *_bt_hal_get_gdbus_node(const gchar *xml_data)
 {
        if (bus_id == 0) {
-               char *name = g_strdup_printf("org.bt.frwk%d", getpid());
+               char *name = g_strdup_printf("org.bt.frwk.p%d", getpid());
 
                bus_id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
                                name,
index f592662..17eecaa 100644 (file)
@@ -3,19 +3,28 @@
 <busconfig>
     <policy user="root">
         <allow own="org.projectx.bt"/>
+        <allow send_destination="org.projectx.bt"/>
+        <allow own="org.bluez.obex"/>
+        <allow send_destination="org.bluez.obex"/>
     </policy>
-    <policy user="network_fw">
+    <policy group="network_fw">
         <allow own="org.projectx.bt"/>
-       <allow send_destination="org.bluez.obex"/>
-       <allow send_destination="org.bluez.obex" send_interface="org.freedesktop.DBus.Properties"/>
-       <allow send_destination="org.projectx.bt" send_interface="org.bluez.obex.Agent1"/>
+        <allow send_destination="org.projectx.bt"/>
+        <allow own="org.bluez.obex"/>
+        <allow send_destination="org.bluez.obex"/>
     </policy>
     <policy context="default">
         <deny own="org.projectx.bt"/>
+        <deny send_destination="org.projectx.bt"/>
+        <deny own="org.bluez.obex"/>
+        <deny send_destination="org.bluez.obex"/>
+
         <allow send_destination="org.projectx.bt" send_interface="org.projectx.bt"/>
+        <allow send_destination="org.projectx.bt" send_interface="org.freedesktop.DBus.Properties" send_member="GetAll"/>
+        <check send_destination="org.projectx.bt" send_interface="org.bluez.Agent1" privilege="http://tizen.org/privilege/bluetooth.admin"/>
+        <allow send_destination="org.projectx.bt" send_interface="org.bluez.obex.reply"/>
         <allow send_destination="org.projectx.bt_event"/>
         <allow send_destination="org.projectx.bluetooth.share"/>
         <allow send_destination="org.tizen.csd.Call.Instance"/>
-       <allow send_destination="org.projectx.bt" send_interface="org.bluez.obex.reply"/>
     </policy>
 </busconfig>