Change session dbus to system dbus 89/190989/3 submit/tizen/20181030.100516
authorWonnam Jang <wn.jang@samsung.com>
Wed, 10 Oct 2018 08:14:29 +0000 (17:14 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 10 Oct 2018 09:57:43 +0000 (18:57 +0900)
Change-Id: I542d32b1091269d4308043c222fe75c7671a35dd
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
13 files changed:
CMakeLists.txt
client/tts_dbus.c
org.tizen.voice.ttsinterruptserver.service
org.tizen.voice.ttsinterruptserver.tv.service
org.tizen.voice.ttsnotiserver.service
org.tizen.voice.ttsnotiserver.tv.service
org.tizen.voice.ttsserver.service
org.tizen.voice.ttsserver.tv.service
org.tizen.voice.ttssrserver.service
org.tizen.voice.ttssrserver.tv.service
packaging/tts.spec
server/ttsd_dbus.c
tts-server.conf

index 3522de2..b462e71 100644 (file)
@@ -61,13 +61,13 @@ ADD_SUBDIRECTORY(engine-parser)
 ## Config ##
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/tts-config.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/tts/1.0)
 
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/tts-server.conf DESTINATION /etc/dbus-1/session.d)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/tts-server.conf DESTINATION /etc/dbus-1/system.d)
 
 ## Dbus service ##
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsnotiserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttssrserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsinterruptserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsnotiserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttssrserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsinterruptserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
 
 ## voice_getengine ##
 IF("${ARCH}" MATCHES "^arm.*")
index 73d9b2d..0c60f4a 100644 (file)
@@ -181,7 +181,7 @@ int tts_dbus_open_connection()
        dbus_error_init(&err);
 
        /* connect to the DBUS system bus, and check for errors */
-       g_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+       g_conn_sender = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Dbus Connection Error (%s)", err.message);
                dbus_error_free(&err);
@@ -194,7 +194,7 @@ int tts_dbus_open_connection()
 
        dbus_connection_set_exit_on_disconnect(g_conn_sender, false);
 
-       g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+       g_conn_listener = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Dbus Connection Error (%s)", err.message);
                dbus_error_free(&err);
index c79f344..492bd6d 100644 (file)
@@ -2,3 +2,5 @@
 Name=org.tizen.voice.ttsinterruptserver
 Exec=/bin/sh -c "voice_getengine get system db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-interrupt mode interrupt"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti"
+User=system
+Group=system
\ No newline at end of file
index d45960e..0ad0b09 100644 (file)
@@ -3,3 +3,5 @@ Name=org.tizen.voice.ttsinterruptserver
 #Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}-noti"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti"
 Exec=/bin/sh -c "launch_app org.tizen.tts-engine-vd-interrupt mode interrupt"
+User=system
+Group=system
\ No newline at end of file
index 715d186..111b70f 100644 (file)
@@ -2,3 +2,5 @@
 Name=org.tizen.voice.ttsnotiserver
 Exec=/bin/sh -c "voice_getengine get system db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-noti mode noti"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti"
+User=system
+Group=system
\ No newline at end of file
index 95ff1d7..188e228 100644 (file)
@@ -3,3 +3,5 @@ Name=org.tizen.voice.ttsnotiserver
 #Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}-noti"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti"
 Exec=/bin/sh -c "launch_app org.tizen.tts-engine-vd-noti mode noti"
+User=system
+Group=system
\ No newline at end of file
index 4a92dde..14527fe 100644 (file)
@@ -2,3 +2,5 @@
 Name=org.tizen.voice.ttsserver
 Exec=/bin/sh -c "voice_getengine get system db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default"
+User=system
+Group=system
\ No newline at end of file
index a30949f..cbca808 100644 (file)
@@ -3,3 +3,5 @@ Name=org.tizen.voice.ttsserver
 #Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default"
 Exec=/bin/sh -c "launch_app org.tizen.tts-engine-vd"
+User=system
+Group=system
\ No newline at end of file
index 119f965..adc2f0e 100644 (file)
@@ -2,3 +2,5 @@
 Name=org.tizen.voice.ttssrserver
 Exec=/bin/sh -c "voice_getengine get system db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-sr mode sr"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-sr mode sr"
+User=system
+Group=system
\ No newline at end of file
index 0833130..3d204d9 100644 (file)
@@ -3,3 +3,5 @@ Name=org.tizen.voice.ttssrserver
 #Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}-sr"
 #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-sr mode sr"
 Exec=/bin/sh -c "launch_app org.tizen.tts-engine-vd-sr mode sr"
+User=system
+Group=system
\ No newline at end of file
index 731ddcf..b0377ab 100644 (file)
@@ -110,15 +110,15 @@ mkdir -p %{TZ_SYS_RO_SHARE}/voice/test
 %defattr(-,root,root,-)
 %{_libdir}/lib*.so
 %{TZ_SYS_RO_SHARE}/voice/tts/1.0/tts-config.xml
-%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttsserver.service
-%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttsnotiserver.service
-%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttssrserver.service
-%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttsinterruptserver.service
+%{TZ_SYS_RO_SHARE}/dbus-1/system-services/org.tizen.voice.ttsserver.service
+%{TZ_SYS_RO_SHARE}/dbus-1/system-services/org.tizen.voice.ttsnotiserver.service
+%{TZ_SYS_RO_SHARE}/dbus-1/system-services/org.tizen.voice.ttssrserver.service
+%{TZ_SYS_RO_SHARE}/dbus-1/system-services/org.tizen.voice.ttsinterruptserver.service
 #%{TZ_SYS_RO_SHARE}/voice/test/tts-test
 %{_bindir}/voice_getengine
 %{TZ_SYS_RO_ETC}/package-manager/parserlib/metadata/libtts-engine-parser.so*
 #%{TZ_SYS_RO_ETC}/package-manager/parserlib/metadata/libtts-engine-language-pack-parser.so*
-/etc/dbus-1/session.d/tts-server.conf
+/etc/dbus-1/system.d/tts-server.conf
 
 %files devel
 %manifest %{name}-devel.manifest
index ce47e61..c69cd30 100644 (file)
@@ -331,7 +331,7 @@ int ttsd_dbus_open_connection()
        int ret;
 
        /* Create connection for sender */
-       g_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+       g_conn_sender = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, tts_tag(), "[Dbus ERROR] Fail dbus_bus_get : %s", err.message);
                dbus_error_free(&err);
@@ -345,7 +345,7 @@ int ttsd_dbus_open_connection()
        dbus_connection_set_exit_on_disconnect(g_conn_sender, false);
 
        /* connect to the bus and check for errors */
-       g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+       g_conn_listener = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, tts_tag(), "[Dbus ERROR] Fail dbus_bus_get : %s", err.message);
                dbus_error_free(&err);
index b88e2c4..9a4b34f 100644 (file)
@@ -2,22 +2,45 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
 
-<!-- root can own the service -->
-  <policy context="default">
-    <allow own_prefix="org.tizen.tts"/>
+  <policy user="root">
     <allow send_destination="org.tizen.tts"/>
-
-    <allow own="org.tizen.voice.ttsserver"/>
     <allow send_destination="org.tizen.voice.ttsserver"/>
-
-    <allow own="org.tizen.voice.ttsnotiserver"/>
     <allow send_destination="org.tizen.voice.ttsnotiserver"/>
+    <allow send_destination="org.tizen.voice.ttssrserver"/>
+    <allow send_destination="org.tizen.voice.ttsinterruptserver"/>
+  </policy>
 
-    <allow own="org.tizen.voice.ttssrserver"/>
+  <policy group="users">
+    <allow send_destination="org.tizen.tts"/>
+    <allow send_destination="org.tizen.voice.ttsserver"/>
+    <allow send_destination="org.tizen.voice.ttsnotiserver"/>
     <allow send_destination="org.tizen.voice.ttssrserver"/>
+    <allow send_destination="org.tizen.voice.ttsinterruptserver"/>
+  </policy>
 
+  <policy user="system">
+    <allow own_prefix="org.tizen.tts"/>
+    <allow own="org.tizen.voice.ttsserver"/>
+    <allow own="org.tizen.voice.ttsnotiserver"/>
+    <allow own="org.tizen.voice.ttssrserver"/>
     <allow own="org.tizen.voice.ttsinterruptserver"/>
-    <allow send_destination="org.tizen.voice.ttsinterruptserver"/>
+  </policy>
+
+  <policy context="default">
+    <deny send_destination="org.tizen.tts"/>
+    <deny own_prefix="org.tizen.tts"/>
+
+    <deny send_destination="org.tizen.voice.ttsserver"/>
+    <deny own="org.tizen.voice.ttsserver"/>
+
+    <deny send_destination="org.tizen.voice.ttsnotiserver"/>
+    <deny own="org.tizen.voice.ttsnotiserver"/>
+
+    <deny send_destination="org.tizen.voice.ttssrserver"/>
+    <deny own="org.tizen.voice.ttssrserver"/>
+
+    <deny send_destination="org.tizen.voice.ttsinterruptserver"/>
+    <deny own="org.tizen.voice.ttsinterruptserver"/>
   </policy>
 
 </busconfig>