Convert d-bus interface name to hexa string 80/163380/3
authorJunghoon Park <jh9216.park@samsung.com>
Mon, 11 Dec 2017 02:39:34 +0000 (11:39 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 11 Dec 2017 05:42:06 +0000 (05:42 +0000)
 - Special letters such as '-' and '+' are not allowed as d-bus interface name

Change-Id: I5c74bdef4321e83ed8e13410fe4b9a19b8c69d1e
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
CMakeLists.txt
packaging/rpc-port.spec
src/fdbroker-internal.cc

index 0c183bc..a9527d3 100644 (file)
@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES (
        ${CMAKE_SOURCE_DIR}/src
        )
 
-SET(${this_target}_requires "dlog bundle glib-2.0 gio-2.0 aul openssl capi-base-common pkgmgr-info gio-unix-2.0")
+SET(${this_target}_requires "dlog bundle glib-2.0 gio-2.0 aul capi-base-common pkgmgr-info gio-unix-2.0")
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${this_target} REQUIRED ${${this_target}_requires})
index 18b8126..282fc9d 100755 (executable)
@@ -13,7 +13,6 @@ BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(pkgmgr)
 BuildRequires:  pkgconfig(pkgmgr-info)
-BuildRequires:  pkgconfig(openssl)
 BuildRequires:  pkgconfig(gmock)
 
 Requires(post): /sbin/ldconfig
index b65bdb6..77ecf6f 100644 (file)
@@ -196,12 +196,16 @@ FdBroker::~FdBroker() {
 
 std::string FdBroker::GetInterfaceName(const std::string& target_appid,
                              const std::string& port_name) {
-  std::string interface_name = RPC_PORT_INTERFACE_PREFIX;
+  std::string interface_name = target_appid + "_" + port_name;
+  char c_buf[interface_name.length() * 2 + 1] = {0};
+  char* temp = &c_buf[0];
 
-  interface_name += target_appid;
-  interface_name += "_" + port_name;
+  for (int index = 0; index < interface_name.length(); index++) {
+    snprintf(temp, 3, "%02x", interface_name[index]);
+    temp += 2;
+  }
 
-  return interface_name;
+  return RPC_PORT_INTERFACE_PREFIX + std::string(c_buf);
 }
 
 int FdBroker::Send(const std::string& target_appid,