From: Junghoon Park Date: Mon, 11 Dec 2017 02:39:34 +0000 (+0900) Subject: Convert d-bus interface name to hexa string X-Git-Tag: submit/tizen/20180312.233038~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f148d094877275d641ff458097b402f14a1fa273;p=platform%2Fcore%2Fappfw%2Frpc-port.git Convert d-bus interface name to hexa string - Special letters such as '-' and '+' are not allowed as d-bus interface name Change-Id: I5c74bdef4321e83ed8e13410fe4b9a19b8c69d1e Signed-off-by: Junghoon Park --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c183bc..a9527d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/packaging/rpc-port.spec b/packaging/rpc-port.spec index 18b8126..282fc9d 100755 --- a/packaging/rpc-port.spec +++ b/packaging/rpc-port.spec @@ -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 diff --git a/src/fdbroker-internal.cc b/src/fdbroker-internal.cc index b65bdb6..77ecf6f 100644 --- a/src/fdbroker-internal.cc +++ b/src/fdbroker-internal.cc @@ -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,