From: kmook Date: Thu, 3 Nov 2016 01:48:57 +0000 (+0900) Subject: Added macro for internal ACL to fix build errors X-Git-Tag: accepted/tizen/common/20161115.200258~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f75ffdb5bb72acb647ee306a93ee74350b53d985;p=platform%2Fcore%2Fconvergence%2Fd2d-conv-manager.git Added macro for internal ACL to fix build errors Change-Id: I4e0d777af34cbe20d39ee9e577cdc882f61340bd Signed-off-by: kmook --- diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 2b28974..aedb920 100755 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -15,18 +15,24 @@ FILE(GLOB DAEMON_SRCS ${DAEMON_SRCS} ../msf_tizen_client/src/*.cpp) SET(provider_deps "glib-2.0 dlog json-glib-1.0 iotcon capi-appfw-app-manager iotcon vconf capi-network-bluetooth capi-network-wifi-direct capi-appfw-application bundle capi-network-connection cynara-creds-gdbus cynara-client cynara-session capi-appfw-package-manager sqlite3 syspopup-caller") SET(provider_deps "${provider_deps} openssl libwebsockets libcurl nsd-dns-sd") + # Mobile profile IF("${PROFILE}" STREQUAL "mobile") ADD_DEFINITIONS("-D_MOBILE_") -# SET(provider_deps "${provider_deps} tapi capi-messaging-messages") ENDIF("${PROFILE}" STREQUAL "mobile") # TV profile IF("${PROFILE}" STREQUAL "tv") ADD_DEFINITIONS("-D_TV_") - SET(provider_deps "${provider_deps} acl-proxy-api") + IF(${D2D_INTERNAL_ACL} EQUAL 0) + SET(provider_deps "${provider_deps} acl-proxy-api") + ENDIF(${D2D_INTERNAL_ACL} EQUAL 0) ENDIF("${PROFILE}" STREQUAL "tv") +IF(${D2D_INTERNAL_ACL} EQUAL 1) + ADD_DEFINITIONS("-D_D2D_INTERNAL_ACL_") +ENDIF(${D2D_INTERNAL_ACL} EQUAL 1) + pkg_check_modules(daemon_pkgs REQUIRED ${provider_deps}) INCLUDE_DIRECTORIES(${daemon_pkgs_INCLUDE_DIRS}) diff --git a/daemon/service_provider/RemoteAppControlServiceProvider.cpp b/daemon/service_provider/RemoteAppControlServiceProvider.cpp index c5f5381..fcddaa0 100755 --- a/daemon/service_provider/RemoteAppControlServiceProvider.cpp +++ b/daemon/service_provider/RemoteAppControlServiceProvider.cpp @@ -20,12 +20,12 @@ #include "RemoteAppControlServiceProvider.h" #include "../ClientManager.h" #include "../Util.h" -#if defined(_TV_) -#include -#else +#if defined(_D2D_INTERNAL_ACL_) #include "../access_control/ACLManager.h" using namespace conv::acl_manager; +#else +#include #endif using namespace std; @@ -247,7 +247,7 @@ static int __access_control(iotcon_request_h request, iotcon_attributes_h attrib _D("UNDECIDED"); policy = CONV_ACCESS_CONTROL_DENIED; } -#if !defined(_TV_) +#if defined(_D2D_INTERNAL_ACL_) else if (acManagerPolicy == ACMANAGER_POLICY_U2) { _D("UNDECIDED"); conv::acl_manager::LaunchPasscodeShowPopup(deviceName); @@ -257,7 +257,7 @@ static int __access_control(iotcon_request_h request, iotcon_attributes_h attrib _D("acManagerPolicy:%d", acManagerPolicy); } -#if !defined(_TV_) +#if defined(_D2D_INTERNAL_ACL_) else if (!strcmp(CONV_ACCESS_CONTROL_PASSCODE_RESPONSE, access_request_type)) { char *input_passcode; @@ -311,7 +311,6 @@ static int __app_control_launch(iotcon_request_h request, iotcon_attributes_h at string ip = conv::util::getIpAddress(hostAddressString); char macAddress[127] = {0,}; - IF_FAIL_RETURN_TAG(conv::util::getPeerMac(ip, -1, macAddress), CONV_ERROR_INVALID_PARAMETER, _E, "getPeerMac failed"); _D("Device IP : %s, Mac : %s", ip.c_str(), macAddress); @@ -400,10 +399,7 @@ static int __app_control_launch(iotcon_request_h request, iotcon_attributes_h at //callback function handles put command for remote-app-control resource static int __handle_request(iotcon_representation_h rep, iotcon_request_h request) { -#if defined(_TV_) - // temporarily blocked by security issue - return CONV_ERROR_INVALID_PARAMETER; -#else +#if defined(_D2D_INTERNAL_ACL_) iotcon_attributes_h attributes; char *requestType; @@ -421,6 +417,9 @@ static int __handle_request(iotcon_representation_h rep, iotcon_request_h reques } return CONV_ERROR_INVALID_PARAMETER; +#else + // temporarily blocked by security issue + return CONV_ERROR_INVALID_PARAMETER; #endif } @@ -572,7 +571,7 @@ static void __on_access_response(iotcon_remote_resource_h resource, iotcon_error return; } -#if !defined(_TV_) +#if defined(_D2D_INTERNAL_ACL_) else if (!strcmp(CONV_ACCESS_CONTROL_PASSCODE_REQUEST, accessControlResult)) { _D("__on_access_response PASSCODE REQUEST"); conv::acl_manager::LaunchPasscodeInputPopup(passcode_popup_callback, svcInfo); @@ -610,7 +609,7 @@ static void __on_access_response(iotcon_remote_resource_h resource, iotcon_error } } -#if !defined(_TV_) +#if defined(_D2D_INTERNAL_ACL_) static void passcode_popup_callback(void *user_data, int result, char *passcode) { conv::RemoteAppControlServiceInfo *svcInfo = reinterpret_cast(user_data); diff --git a/packaging/d2d-conv-manager.spec b/packaging/d2d-conv-manager.spec index c4dd57c..1207422 100755 --- a/packaging/d2d-conv-manager.spec +++ b/packaging/d2d-conv-manager.spec @@ -11,6 +11,7 @@ Source1001: %{name}.manifest Source1002: lib%{name}.manifest %define BUILD_PROFILE %{?profile}%{!?profile:%{?tizen_profile_name}} +%define INTERNAL_ACL %{?TIZEN_PROFILE_TV:0}%{!?TIZEN_PROFILE_TV:1} BuildRequires: cmake BuildRequires: pkgconfig(gio-2.0) @@ -20,7 +21,6 @@ BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(json-glib-1.0) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(iotcon) -#BuildRequires: pkgconfig(security-server) BuildRequires: pkgconfig(capi-appfw-app-manager) BuildRequires: pkgconfig(libwebsockets) BuildRequires: pkgconfig(iotcon) @@ -45,9 +45,11 @@ BuildRequires: curl BuildRequires: libcurl-devel %if "%{?BUILD_PROFILE}" == "tv" +%if %{?INTERNAL_ACL} == 0 BuildRequires: pkgconfig(acl-proxy-api) BuildRequires: pkgconfig(securestorage-client) %endif +%endif %define _userdatadir /opt/usr/data/d2d-conv-manager @@ -80,7 +82,7 @@ D2D Convergence Manager development kit. %build MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} -DPROFILE=%{?BUILD_PROFILE} +%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} -DPROFILE=%{?BUILD_PROFILE} -DD2D_INTERNAL_ACL=%{?INTERNAL_ACL} %install