From d1a42c4efa80aff8d2c06c0f41c405c134f73830 Mon Sep 17 00:00:00 2001 From: Kyungwook Tak Date: Mon, 16 Jan 2017 11:01:32 +0900 Subject: [PATCH] Remove platform version diff handling The csr project was developed on both of 2.4 and 3.0 tizen version at first but 2.4 is forked to other package and no more maintanance needed in here. Also the branch tizen need not to support tizen version lower than 3, so remove all codes related. Change-Id: I912d9f9c6a345d0d6a21192eda56e39cb0d9cb79 Signed-off-by: Kyungwook Tak --- CMakeLists.txt | 19 +++------ packaging/csr-framework.spec | 28 +------------ packaging/csr-test.manifest.smack.in | 34 --------------- packaging/csr.manifest.smack.in | 50 ---------------------- src/CMakeLists.txt | 12 ++---- src/framework/CMakeLists.txt | 12 ++---- src/framework/common/credential-cynara.cpp | 5 --- src/framework/common/credential-smack.cpp | 58 -------------------------- src/framework/common/credential.h | 1 - src/framework/service/access-control-smack.cpp | 49 ---------------------- src/framework/service/app-deleter.cpp | 6 --- src/framework/service/app-dirs.cpp | 10 ----- src/framework/service/file-system.cpp | 5 --- systemd/CMakeLists.txt | 9 +--- systemd/csr-popup.service.old.in | 11 ----- systemd/csr-popup.socket.old.in | 14 ------- test/test-common.cpp | 17 -------- test/test-resource.cpp | 6 --- 18 files changed, 15 insertions(+), 331 deletions(-) delete mode 100644 packaging/csr-test.manifest.smack.in delete mode 100644 packaging/csr.manifest.smack.in delete mode 100644 src/framework/common/credential-smack.cpp delete mode 100644 src/framework/service/access-control-smack.cpp delete mode 100644 systemd/csr-popup.service.old.in delete mode 100644 systemd/csr-popup.socket.old.in diff --git a/CMakeLists.txt b/CMakeLists.txt index cd78fcc..c136b0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,20 +76,13 @@ SET(LOCALEDIR "${RO_DATA_DIR}/locale") CONFIGURE_FILE(packaging/${SERVICE_NAME}-client.manifest.in ${SERVICE_NAME}-client.manifest @ONLY) CONFIGURE_FILE(packaging/${SERVICE_NAME}-common.manifest.in ${SERVICE_NAME}-common.manifest @ONLY) -IF (PLATFORM_VERSION_3) - ADD_DEFINITIONS("-DPLATFORM_VERSION_3") +ADD_DEFINITIONS("-DTZ_SYS_STORAGE=\"${TZ_SYS_STORAGE}\"") +ADD_DEFINITIONS("-DTZ_SYS_RW_APP=\"${TZ_SYS_RW_APP}\"") +ADD_DEFINITIONS("-DTZ_SYS_RO_APP=\"${TZ_SYS_RO_APP}\"") - ADD_DEFINITIONS("-DTZ_SYS_STORAGE=\"${TZ_SYS_STORAGE}\"") - ADD_DEFINITIONS("-DTZ_SYS_RW_APP=\"${TZ_SYS_RW_APP}\"") - ADD_DEFINITIONS("-DTZ_SYS_RO_APP=\"${TZ_SYS_RO_APP}\"") - - CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.in ${SERVICE_NAME}.manifest @ONLY) - CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.in ${SERVICE_NAME}-test.manifest @ONLY) - CONFIGURE_FILE(data/scripts/500.${SERVICE_NAME}.sh.in data/scripts/500.${SERVICE_NAME}.sh @ONLY) -ELSE (PLATFORM_VERSION_3) - CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.smack.in ${SERVICE_NAME}.manifest @ONLY) - CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.smack.in ${SERVICE_NAME}-test.manifest @ONLY) -ENDIF (PLATFORM_VERSION_3) +CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.in ${SERVICE_NAME}.manifest @ONLY) +CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.in ${SERVICE_NAME}-test.manifest @ONLY) +CONFIGURE_FILE(data/scripts/500.${SERVICE_NAME}.sh.in data/scripts/500.${SERVICE_NAME}.sh @ONLY) IF (DEFINED DETAILED_URL_BASE) MESSAGE("Use base of detailed url: ${DETAILED_URL_BASE}") diff --git a/packaging/csr-framework.spec b/packaging/csr-framework.spec index 226679e..053255d 100644 --- a/packaging/csr-framework.spec +++ b/packaging/csr-framework.spec @@ -41,12 +41,8 @@ BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(efl-extension) BuildRequires: pkgconfig(icu-i18n) -%if 0%{?tizen_version_major} >= 3 BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(cynara-client) -%else -BuildRequires: pkgconfig(libsmack) -%endif Requires: lib%{name}-common = %{version}-%{release} %{?systemd_requires} @@ -67,7 +63,6 @@ file contents and checking url to prevent malicious items. %global test_dir %{rw_data_dir}/%{service_name}-test %global test_res_dir %{ro_data_dir}/%{service_name}-test -%if 0%{?tizen_version_major} >= 3 %global service_user security_fw %global service_group security_fw %global test_user owner @@ -75,24 +70,12 @@ file contents and checking url to prevent malicious items. %global smack_domain_name System %global popup_unitdir %{_unitdir_user} %global upgrade_script_dir %{ro_data_dir}/upgrade/scripts -%else -%global service_user system -%global service_group system -%global test_user system -%global smack_domain_name %{service_name} -%global popup_service_env_file_path /run/tizen-mobile-env -%global popup_unitdir %{_unitdir} -%endif %package -n lib%{name}-common Summary: CSR framework (common library) License: Apache-2.0 Group: Security/Libraries -%if 0%{?tizen_version_major} >= 3 BuildRequires: pkgconfig(cynara-creds-socket) -%else -BuildRequires: pkgconfig(libsmack) -%endif Requires: %{sbin_dir}/ldconfig %description -n lib%{name}-common @@ -187,14 +170,9 @@ Content Screening and Reputation framework (test program) %else -DWITH_SAMPLE_ENGINE:BOOL=OFF \ %endif -%if 0%{?tizen_version_major} >= 3 -DTZ_SYS_STORAGE=%TZ_SYS_STORAGE \ -DTZ_SYS_RW_APP=%TZ_SYS_RW_APP \ - -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \ - -DPLATFORM_VERSION_3:BOOL=ON -%else - -DPLATFORM_VERSION_3:BOOL=OFF -%endif + -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP make %{?jobs:-j%jobs} @@ -209,10 +187,8 @@ mkdir -p %{buildroot}%{rw_db_dir} mkdir -p %{buildroot}%{ro_db_dir} cp data/scripts/*.sql %{buildroot}%{ro_db_dir} -%if 0%{?tizen_version_major} >= 3 mkdir -p %{buildroot}%{upgrade_script_dir} cp data/scripts/500.%{service_name}.sh %{buildroot}%{upgrade_script_dir} -%endif mkdir -p %{buildroot}%{engine_dir} mkdir -p %{buildroot}%{engine_rw_working_dir} @@ -294,9 +270,7 @@ chsmack -a "_" %{test_dir}/test_dir/dir1 %dir %attr(775, %{service_user}, %{service_group}) %{engine_rw_working_dir} # RW area platform upgrade script -%if 0%{?tizen_version_major} >= 3 %attr(755, -, -) %{upgrade_script_dir}/500.%{service_name}.sh -%endif %files -n lib%{name}-common %defattr(-,root,root,-) diff --git a/packaging/csr-test.manifest.smack.in b/packaging/csr-test.manifest.smack.in deleted file mode 100644 index 4bdc1a6..0000000 --- a/packaging/csr-test.manifest.smack.in +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packaging/csr.manifest.smack.in b/packaging/csr.manifest.smack.in deleted file mode 100644 index a5cc4da..0000000 --- a/packaging/csr.manifest.smack.in +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8fe7fe3..b681e20 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,15 +19,9 @@ ############### SERVER ################### -IF (PLATFORM_VERSION_3) - MESSAGE("Use Cynara as access control backend") - SET(AC_BACKEND_REQUIRE cynara-client) - SET(AC_BACKEND_SRCS framework/service/access-control-cynara.cpp) -ELSE (PLATFORM_VERSION_3) - MESSAGE("Use Smack as access control backend") - SET(AC_BACKEND_REQUIRE libsmack) - SET(AC_BACKEND_SRCS framework/service/access-control-smack.cpp) -ENDIF (PLATFORM_VERSION_3) +MESSAGE("Use Cynara as access control backend") +SET(AC_BACKEND_REQUIRE cynara-client) +SET(AC_BACKEND_SRCS framework/service/access-control-cynara.cpp) PKG_CHECK_MODULES(${TARGET_CSR_SERVER}_DEP REQUIRED diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index 8cad4a3..cce5435 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -17,15 +17,9 @@ # @brief Make common library for both of server and client # -IF (PLATFORM_VERSION_3) - MESSAGE("Use Cynara as access control backend") - SET(AC_BACKEND_COMMON_REQUIRE cynara-creds-socket) - SET(AC_BACKEND_COMMON_SRCS common/credential-cynara.cpp) -ELSE (PLATFORM_VERSION_3) - MESSAGE("Use Smack as access control backend") - SET(AC_BACKEND_COMMON_REQUIRE libsmack) - SET(AC_BACKEND_COMMON_SRCS common/credential-smack.cpp) -ENDIF (PLATFORM_VERSION_3) +MESSAGE("Use Cynara as access control backend") +SET(AC_BACKEND_COMMON_REQUIRE cynara-creds-socket) +SET(AC_BACKEND_COMMON_SRCS common/credential-cynara.cpp) PKG_CHECK_MODULES(${TARGET_CSR_COMMON}_DEP REQUIRED diff --git a/src/framework/common/credential-cynara.cpp b/src/framework/common/credential-cynara.cpp index 17046ce..2c34ec3 100644 --- a/src/framework/common/credential-cynara.cpp +++ b/src/framework/common/credential-cynara.cpp @@ -32,11 +32,6 @@ namespace Csr { Credential::Credential(const std::string &_user, const std::string &_client) : user(_user), client(_client) {} -Credential::Credential(uid_t, gid_t, const std::string &) -{ - ThrowExc(CSR_ERROR_SERVER, "Invalid credential ctor called which is for smack backend."); -} - std::unique_ptr Credential::get(int sockfd) { char *userptr = nullptr; diff --git a/src/framework/common/credential-smack.cpp b/src/framework/common/credential-smack.cpp deleted file mode 100644 index 143d1f9..0000000 --- a/src/framework/common/credential-smack.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ -/* - * @file credential-smack.cpp - * @author Kyungwook Tak (k.tak@samsung.com) - * @version 1.0 - * @brief - */ -#include "common/credential.h" - -#include -#include -#include - -#include "common/exception.h" - -namespace Csr { - -Credential::Credential(uid_t _uid, gid_t _gid, const std::string &_label) : - uid(_uid), gid(_gid), label(_label) {} - -Credential::Credential(const std::string &, const std::string &) -{ - ThrowExc(CSR_ERROR_SERVER, "Invalid credential ctor called which is for cynara backend."); -} - -std::unique_ptr Credential::get(int sockfd) -{ - struct ucred cred; - socklen_t lenCred = sizeof(ucred); - - if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &cred, &lenCred) != 0) - ThrowExc(CSR_ERROR_SERVER, "getsockopt peercred failed. errno: " << errno); - - std::vector label(SMACK_LABEL_LEN + 1, '0'); - socklen_t lenLabel = SMACK_LABEL_LEN; - - if (getsockopt(sockfd, SOL_SOCKET, SO_PEERSEC, label.data(), &lenLabel) != 0) - ThrowExc(CSR_ERROR_SERVER, "getsockopt peersec failed. errno: " << errno); - - return std::unique_ptr(new Credential(cred.uid, cred.gid, - std::string(label.data(), lenLabel))); -} - -} diff --git a/src/framework/common/credential.h b/src/framework/common/credential.h index 4f8f1e8..9e35143 100644 --- a/src/framework/common/credential.h +++ b/src/framework/common/credential.h @@ -39,7 +39,6 @@ struct API Credential { static std::unique_ptr get(int sockfd); private: - explicit Credential(uid_t, gid_t, const std::string &); explicit Credential(const std::string &user, const std::string &client); }; diff --git a/src/framework/service/access-control-smack.cpp b/src/framework/service/access-control-smack.cpp deleted file mode 100644 index 48c6784..0000000 --- a/src/framework/service/access-control-smack.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ -/* - * @file access-control-smack.cpp - * @author Kyungwook Tak (k.tak@samsung.com) - * @version 1.0 - * @brief access control with smack backend - */ -#include "service/access-control.h" - -#include - -#include "common/exception.h" - -namespace Csr { - -void hasPermission(const ConnShPtr &conn) -{ - hasPermission(conn, conn->getSockId()); -} - -void hasPermission(const ConnShPtr &conn, SockId sockId) -{ - const auto &cred = conn->getCredential(); - const auto &sockDesc = getSockDesc(sockId); - - auto ret = smack_have_access(cred.label.c_str(), sockDesc.label.c_str(), "w"); - if (ret < 0) - ThrowExc(CSR_ERROR_SERVER, "smack_have_access failed."); - - if (ret != 1) - ThrowExc(CSR_ERROR_PERMISSION_DENIED, "Client[" << cred.label << "] doesn't have" - " permission to call API. Checked by smack."); -} - -} diff --git a/src/framework/service/app-deleter.cpp b/src/framework/service/app-deleter.cpp index e3cfe8a..8d20db9 100644 --- a/src/framework/service/app-deleter.cpp +++ b/src/framework/service/app-deleter.cpp @@ -44,18 +44,12 @@ void AppDeleter::remove(const std::string &pkgid, const std::string &username) throw std::bad_alloc(); int ret = PKGMGR_R_OK; -#ifdef PLATFORM_VERSION_3 if (username.empty()) ret = ::pkgmgr_client_uninstall(client.get(), nullptr, pkgid.c_str(), PM_QUIET, nullptr, nullptr); else ret = ::pkgmgr_client_usr_uninstall(client.get(), nullptr, pkgid.c_str(), PM_QUIET, nullptr, nullptr, getUid(username)); -#else - (void) username; - ret = ::pkgmgr_client_uninstall(client.get(), nullptr, pkgid.c_str(), PM_QUIET, - nullptr, nullptr); -#endif if (ret < PKGMGR_R_OK) ThrowExc(CSR_ERROR_REMOVE_FAILED, "Failed to pkgmgr_client_uninstall for pkg: " << diff --git a/src/framework/service/app-dirs.cpp b/src/framework/service/app-dirs.cpp index 16ec314..91d13c7 100644 --- a/src/framework/service/app-dirs.cpp +++ b/src/framework/service/app-dirs.cpp @@ -47,7 +47,6 @@ void AppDirs::initOnce() { #define __INS_REGEX(str) AppDirs::m_regex.emplace_back(_regex(str)) -#ifdef PLATFORM_VERSION_3 // internal storages __INS_REGEX("^(" TZ_SYS_RW_APP "/([^/]+))"); // $TZ_SYS_RW_APP/{pkgid}/ __INS_REGEX("^(" TZ_SYS_RO_APP "/([^/]+))"); // $TZ_SYS_RO_APP/{pkgid}/ @@ -65,15 +64,6 @@ void AppDirs::initOnce() __INS_REGEX("^(" TZ_SYS_STORAGE "/sdcard/app2sd/([^/]+))"); __INS_REGEX("^(" TZ_SYS_STORAGE "/sdcard/app2sd/([^/]+)/([^/]+))"); __INS_REGEX("^(" TZ_SYS_STORAGE "/sdcard/apps/([^/]+)/apps_rw/([^/]+))"); -#else - // internal storages - __INS_REGEX("^(/usr/apps/([^/]+))"); // /usr/apps/{pkgid}/ - __INS_REGEX("^(/opt/usr/apps/([^/]+))"); // /opt/usr/apps/{pkgid}/ - - // external storages - __INS_REGEX("^(/sdcard/apps/([^/]+))"); // /sdcard/apps/{pkgid}/ - __INS_REGEX("^(/sdcard/app2sd/([^/]+))"); // /sdcard/app2sd/{pkgid}/ -#endif #undef __INS_REGEX } diff --git a/src/framework/service/file-system.cpp b/src/framework/service/file-system.cpp index 8458052..6d5ac4f 100644 --- a/src/framework/service/file-system.cpp +++ b/src/framework/service/file-system.cpp @@ -43,16 +43,11 @@ int File::getPkgTypes(const std::string &user, const std::string &pkgid) { pkgmgrinfo_pkginfo_h handle; -#ifdef PLATFORM_VERSION_3 int ret = -1; if (user.empty()) ret = ::pkgmgrinfo_pkginfo_get_pkginfo(pkgid.c_str(), &handle); else ret = ::pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid.c_str(), getUid(user), &handle); -#else - (void) user; - auto ret = ::pkgmgrinfo_pkginfo_get_pkginfo(pkgid.c_str(), &handle); -#endif if (ret != PMINFO_R_OK) { INFO("Extracted pkgid[" << pkgid << "] from filepath isn't pkg id. " diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt index ead31e0..01d8621 100644 --- a/systemd/CMakeLists.txt +++ b/systemd/CMakeLists.txt @@ -17,13 +17,8 @@ CONFIGURE_FILE(${SERVICE_NAME}-cs.socket.in ${SERVICE_NAME}-cs.socket @ONLY) CONFIGURE_FILE(${SERVICE_NAME}-wp.socket.in ${SERVICE_NAME}-wp.socket @ONLY) CONFIGURE_FILE(${SERVICE_NAME}-admin.socket.in ${SERVICE_NAME}-admin.socket @ONLY) -IF (PLATFORM_VERSION_3) - CONFIGURE_FILE(${SERVICE_NAME}-popup.service.in ${SERVICE_NAME}-popup.service @ONLY) - CONFIGURE_FILE(${SERVICE_NAME}-popup.socket.in ${SERVICE_NAME}-popup.socket @ONLY) -ELSE (PLATFORM_VERSION_3) - CONFIGURE_FILE(${SERVICE_NAME}-popup.service.old.in ${SERVICE_NAME}-popup.service @ONLY) - CONFIGURE_FILE(${SERVICE_NAME}-popup.socket.old.in ${SERVICE_NAME}-popup.socket @ONLY) -ENDIF (PLATFORM_VERSION_3) +CONFIGURE_FILE(${SERVICE_NAME}-popup.service.in ${SERVICE_NAME}-popup.service @ONLY) +CONFIGURE_FILE(${SERVICE_NAME}-popup.socket.in ${SERVICE_NAME}-popup.socket @ONLY) INSTALL( FILES diff --git a/systemd/csr-popup.service.old.in b/systemd/csr-popup.service.old.in deleted file mode 100644 index 10ec73a..0000000 --- a/systemd/csr-popup.service.old.in +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=CSR popup service for user session - -[Service] -User=app -Group=app -SmackProcessLabel=@SMACK_DOMAIN_NAME@ -Type=simple -EnvironmentFile=@POPUP_SERVICE_ENV_FILE_PATH@ -ExecStart=@BIN_DIR@/@SERVICE_NAME@-popup -Sockets=@SERVICE_NAME@-popup.socket diff --git a/systemd/csr-popup.socket.old.in b/systemd/csr-popup.socket.old.in deleted file mode 100644 index 5ac7642..0000000 --- a/systemd/csr-popup.socket.old.in +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description= Csr popup socket -Wants=@SERVICE_NAME@-popup.service -Before=@SERVICE_NAME@-popup.service - -[Socket] -ListenStream=/tmp/.@SERVICE_NAME@-popup.socket -Service=@SERVICE_NAME@-popup.service -SocketMode=0777 -SmackLabelIPIn=* -SmackLabelIPOut=@ - -[Install] -WantedBy=sockets.target diff --git a/test/test-common.cpp b/test/test-common.cpp index cb776b6..017c9ca 100644 --- a/test/test-common.cpp +++ b/test/test-common.cpp @@ -45,13 +45,8 @@ struct PkgEventData { PkgEventData() : isSuccess(false), loop(nullptr) {} }; -#ifdef PLATFORM_VERSION_3 int __quit_loop_on_end_cb(uid_t, int req_id, const char *pkg_type, const char *pkgid, const char *key, const char *val, const void *pmsg, void *data) -#else -int __quit_loop_on_end_cb(int req_id, const char *pkg_type, const char *pkgid, - const char *key, const char *val, const void *pmsg, void *data) -#endif { (void) req_id; (void) pkg_type; @@ -417,41 +412,29 @@ bool is_file_exist(const char *file) bool uninstall_app(const char *pkg_id) { return pkgmgr_request([&](pkgmgr_client *pc, PkgEventData *data) { -#ifdef PLATFORM_VERSION_3 return ::pkgmgr_client_usr_uninstall(pc, nullptr, pkg_id, PM_QUIET, __quit_loop_on_end_cb, data, ::getuid()); -#else - return ::pkgmgr_client_uninstall(pc, nullptr, pkg_id, PM_QUIET, - __quit_loop_on_end_cb, data); -#endif }); } bool install_app(const char *app_path, const char *pkg_type) { return pkgmgr_request([&](pkgmgr_client *pc, PkgEventData *data) { -#ifdef PLATFORM_VERSION_3 return ::pkgmgr_client_usr_install(pc, pkg_type, nullptr, app_path, nullptr, PM_QUIET, __quit_loop_on_end_cb, data, ::getuid()); -#else - return ::pkgmgr_client_install(pc, pkg_type, nullptr, app_path, nullptr, PM_QUIET, - __quit_loop_on_end_cb, data); -#endif }); } void initialize_db() { #if 0 -#ifdef PLATFORM_VERSION_3 remove_file(RW_DBSPACE ".csr.db"); remove_file(RW_DBSPACE ".csr.db-journal"); int ret = system("systemctl restart csr.service"); BOOST_MESSAGE("CSR DB Initalization & Daemon Restart. Result=" << ret); #endif -#endif } } // namespace Test diff --git a/test/test-resource.cpp b/test/test-resource.cpp index ce73bf7..4e4c871 100644 --- a/test/test-resource.cpp +++ b/test/test-resource.cpp @@ -45,7 +45,6 @@ std::string s_tpkMalFile; std::string s_fakeAppRoot; std::string s_fakeAppFile; -#ifdef PLATFORM_VERSION_3 std::string getUsername(void) { struct passwd pwd; @@ -62,7 +61,6 @@ std::string getUsername(void) return std::string(pwd.pw_name); } -#endif } // namespace anonymous @@ -83,11 +81,7 @@ const char *TEST_DIR_MEDIA(void) const char *TEST_DIR_APPS(void) { if (s_testDirApps.empty()) -#ifdef PLATFORM_VERSION_3 s_testDirApps = "/home/" + ::getUsername() + "/apps_rw"; -#else - s_testDirApps = "/opt/usr/apps"; -#endif return s_testDirApps.c_str(); } -- 2.7.4