From f5d42fe08f1678135f1a2bae8e10310e86e1b779 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Mon, 5 Jun 2017 16:25:47 +0900 Subject: [PATCH] Modify the pid and gid of pbap agent to network_fw Change-Id: I5ff0b5d2c4e014a484be495bc8ac5c786865028b Signed-off-by: DoHyun Pyun --- map-agent/CMakeLists.txt | 2 +- map-agent/bluetooth_map_agent.c | 4 ++-- packaging/bluetooth-agent.spec | 10 +++++----- packaging/bluetooth-pbap-agent.service | 5 ++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/map-agent/CMakeLists.txt b/map-agent/CMakeLists.txt index e58e60e..8b7ce48 100644 --- a/map-agent/CMakeLists.txt +++ b/map-agent/CMakeLists.txt @@ -20,4 +20,4 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_map_agent_LDFLAGS}) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.map_agent.service DESTINATION share/dbus-1/services) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.map_agent.service DESTINATION share/dbus-1/system-services) diff --git a/map-agent/bluetooth_map_agent.c b/map-agent/bluetooth_map_agent.c index 77c61e7..5f59b9f 100644 --- a/map-agent/bluetooth_map_agent.c +++ b/map-agent/bluetooth_map_agent.c @@ -378,7 +378,7 @@ static GDBusConnection *__bt_map_get_gdbus_connection(void) if (map_dbus_conn) return map_dbus_conn; - map_dbus_conn = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &err); + map_dbus_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err); if (!map_dbus_conn) { if (err) { ERR("Unable to connect to dbus: %s", err->message); @@ -1511,7 +1511,7 @@ static gboolean __bt_map_dbus_init(void) return FALSE; } - owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, + owner_id = g_bus_own_name(G_BUS_TYPE_SYSTEM, BT_MAP_SERVICE_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, NULL, NULL, NULL, diff --git a/packaging/bluetooth-agent.spec b/packaging/bluetooth-agent.spec index da3f618..7f8b779 100644 --- a/packaging/bluetooth-agent.spec +++ b/packaging/bluetooth-agent.spec @@ -181,7 +181,7 @@ pushd common_build popd %endif -install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/user/bluetooth-map-agent.service +install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service # This usage of profile macro does NOT conflict 4.0 configurability. %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" # Original: wearable, ivi. Added: common, "undefined" @@ -226,14 +226,14 @@ rm %{_bindir}/bluetooth-hf-agent %license LICENSE %{_bindir}/bluetooth-hf-agent %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service -%exclude %{_libdir}/systemd/user/bluetooth-map-agent.service +%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service %files profile_ivi %license LICENSE %{_bindir}/bluetooth-hf-agent.ivi %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service -%exclude %{_libdir}/systemd/user/bluetooth-map-agent.service +%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service %endif @@ -246,11 +246,11 @@ rm %{_bindir}/bluetooth-hf-agent %{_bindir}/bluetooth-map-agent %{_bindir}/bluetooth-pb-agent %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service -%{_datadir}/dbus-1/services/org.bluez.map_agent.service +%{_datadir}/dbus-1/system-services/org.bluez.map_agent.service %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf -%{_libdir}/systemd/user/bluetooth-map-agent.service +%{_libdir}/systemd/system/bluetooth-map-agent.service %{_libdir}/systemd/system/bluetooth-pbap-agent.service %endif diff --git a/packaging/bluetooth-pbap-agent.service b/packaging/bluetooth-pbap-agent.service index fe5578d..895ffd3 100644 --- a/packaging/bluetooth-pbap-agent.service +++ b/packaging/bluetooth-pbap-agent.service @@ -2,10 +2,9 @@ Description=Bluetooth PBAP Agent [Service] -User=owner -Group=users +User=network_fw +Group=network_fw SupplementaryGroups=priv_message_read Type=dbus BusName=org.bluez.pb_agent -SmackProcessLabel=User ExecStart=/usr/bin/bluetooth-pb-agent -- 2.7.4