Fix privilege violation 59/178059/2
authorWootak Jung <wootak.jung@samsung.com>
Tue, 8 May 2018 04:32:32 +0000 (13:32 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 8 May 2018 04:41:07 +0000 (13:41 +0900)
Need default deny policy for internal interface

Change-Id: If7ecc83424efb736f6d30a0ac43a0a510bf51437

bt-oal/bluez_hal/CMakeLists.txt
bt-oal/bluez_hal/bluetooth-frwk-gap-agent.conf [new file with mode: 0644]
packaging/bluetooth-frwk.spec

index b06effc..fd706b8 100644 (file)
@@ -93,3 +93,4 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bluez_hal_pkgs_LDFLAGS} "-ldl")
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR} COMPONENT RuntimeLibraries)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-gap-agent.conf DESTINATION /etc/dbus-1/system.d)
diff --git a/bt-oal/bluez_hal/bluetooth-frwk-gap-agent.conf b/bt-oal/bluez_hal/bluetooth-frwk-gap-agent.conf
new file mode 100644 (file)
index 0000000..9d1e018
--- /dev/null
@@ -0,0 +1,13 @@
+<!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 send_destination="org.projectx.bt" send_interface="org.bluez.Agent1"/>
+    </policy>
+    <policy group="network_fw">
+        <allow send_destination="org.projectx.bt" send_interface="org.bluez.Agent1"/>
+    </policy>
+    <policy context="default">
+        <deny send_destination="org.projectx.bt" send_interface="org.bluez.Agent1"/>
+    </policy>
+</busconfig>
index 4e350d5..0593cf1 100644 (file)
@@ -578,6 +578,7 @@ popd
 %files oal
 %manifest %{name}.manifest
 %{_libdir}/libbt-oal.so*
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-gap-agent.conf
 
 %if %{bt_bluez_hal} == ENABLED
 %manifest %{name}.manifest