Remove platform version diff handling 24/110324/1
authorKyungwook Tak <k.tak@samsung.com>
Mon, 16 Jan 2017 02:01:32 +0000 (11:01 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Mon, 16 Jan 2017 02:07:58 +0000 (11:07 +0900)
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 <k.tak@samsung.com>
18 files changed:
CMakeLists.txt
packaging/csr-framework.spec
packaging/csr-test.manifest.smack.in [deleted file]
packaging/csr.manifest.smack.in [deleted file]
src/CMakeLists.txt
src/framework/CMakeLists.txt
src/framework/common/credential-cynara.cpp
src/framework/common/credential-smack.cpp [deleted file]
src/framework/common/credential.h
src/framework/service/access-control-smack.cpp [deleted file]
src/framework/service/app-deleter.cpp
src/framework/service/app-dirs.cpp
src/framework/service/file-system.cpp
systemd/CMakeLists.txt
systemd/csr-popup.service.old.in [deleted file]
systemd/csr-popup.socket.old.in [deleted file]
test/test-common.cpp
test/test-resource.cpp

index cd78fcc..c136b0d 100644 (file)
@@ -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}")
index 226679e..053255d 100644 (file)
@@ -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 (file)
index 4bdc1a6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<manifest>
-       <define>
-               <domain name="@SERVICE_NAME@-test" />
-               <request>
-                       <smack request="device::sys_logging" type="rw" />
-                       <smack request="device::app_logging" type="rw" />
-                       <smack request="sys-assert::core" type="rwxat" />
-                       <smack request="systemd" type="rx" />
-                       <smack request="tizen::vconf::setting::admin" type="rl" />
-                       <smack request="@SERVICE_NAME@" type="rwxat" />
-                       <smack request="sdbd" type="rx" />
-                       <smack request="pkgmgr::db" type="rwx" />
-                       <smack request="pkgmgr::svc" type="r" />
-
-                       <smack request="csr::csapi" type="w" />
-                       <smack request="csr::wpapi" type="w" />
-                       <smack request="csr::adminapi" type="w" />
-
-                       <smack request="system::media" type="rwxat" />
-                       <smack request="system::homedir" type="rwxat" />
-                       <smack request="_" type="rwx" />
-               </request>
-               <permit>
-                       <smack permit="_" type="rx" />
-                       <smack permit="pkgmgr" type="rx" />
-                       <smack permit="pkgmgr-server" type="rx" />
-                       <smack permit="wrt-installer" type="rx" />
-                       <smack permit="@SERVICE_NAME@" type="rwxat" />
-               </permit>
-       </define>
-       <request>
-               <domain name="@SERVICE_NAME@-test" />
-       </request>
-</manifest>
diff --git a/packaging/csr.manifest.smack.in b/packaging/csr.manifest.smack.in
deleted file mode 100644 (file)
index a5cc4da..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<manifest>
-       <define>
-               <domain name="@SERVICE_NAME@" />
-               <request>
-                       <smack request="device::sys_logging" type="rw" />
-                       <smack request="device::app_logging" type="rw" />
-                       <smack request="sys-assert::core" type="rwxat" />
-                       <smack request="systemd" type="rx" />
-                       <smack request="xorg" type="rwxat" />
-                       <smack request="tizen::vconf::setting" type="rl" />
-                       <smack request="tizen::vconf::setting::admin" type="rl" />
-                       <smack request="tizen::vconf::public::r::platform::rw" type="rl" />
-                       <smack request="tizen::vconf::camcorder" type="rl" />
-                       <smack request="isf" type="rx" />
-                       <smack request="dbus" type="w" />
-                       <smack request="pulseaudio" type="w" />
-                       <smack request="sdbd" type="rwxat" />
-                       <smack request="pkgmgr::db" type="rwx" />
-                       <smack request="pkgmgr::svc" type="r" />
-                       <smack request="system::use_internet" type="w" />
-                       <smack request="aul::launch" type="x" />
-                       <smack request="app-svc::db" type="rw" />
-
-                       <smack request="system::media" type="rwxat" />
-                       <smack request="system::homedir" type="rwxat" />
-                       <smack request="system::ext_storage" type="rwxat" />
-                       <smack request="system::ext_storage_appdata" type="rwxat" />
-                       <smack request="system::clipboard" type="rwxat" />
-                       <smack request="data-provider-master::share" type="rwxat" />
-                       <smack request="data-provider-master::bin" type="rl" />
-                       <smack request="rpm-backend" type="rl" />
-                       <smack request="tpk-backend" type="rl" />
-                       <smack request="wgt-backend" type="rl" />
-               </request>
-               <permit>
-                       <smack permit="_" type="rwx" />
-                       <smack permit="xorg" type="rx" />
-                       <smack permit="pkgmgr" type="rx" />
-                       <smack permit="pkgmgr-server" type="rx" />
-                       <smack permit="wrt-installer" type="rx" />
-                       <smack permit="system::use_internet" type="w" />
-                       <smack permit="dbus" type="rx" />
-
-                       <smack permit="crash-worker" type="rx" />
-               </permit>
-       </define>
-       <request>
-               <domain name="@SERVICE_NAME@" />
-       </request>
-</manifest>
index 8fe7fe3..b681e20 100755 (executable)
 
 ###############     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
index 8cad4a3..cce5435 100644 (file)
 # @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
index 17046ce..2c34ec3 100644 (file)
@@ -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> 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 (file)
index 143d1f9..0000000
+++ /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 <vector>
-#include <sys/socket.h>
-#include <sys/smack.h>
-
-#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> 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<char> 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<Credential>(new Credential(cred.uid, cred.gid,
-                                                                          std::string(label.data(), lenLabel)));
-}
-
-}
index 4f8f1e8..9e35143 100644 (file)
@@ -39,7 +39,6 @@ struct API Credential {
        static std::unique_ptr<Credential> 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 (file)
index 48c6784..0000000
+++ /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 <sys/smack.h>
-
-#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.");
-}
-
-}
index e3cfe8a..8d20db9 100644 (file)
@@ -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: " <<
index 16ec314..91d13c7 100644 (file)
@@ -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
 }
index 8458052..6d5ac4f 100644 (file)
@@ -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. "
index ead31e0..01d8621 100644 (file)
@@ -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 (file)
index 10ec73a..0000000
+++ /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 (file)
index 5ac7642..0000000
+++ /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
index cb776b6..017c9ca 100644 (file)
@@ -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
index ce73bf7..4e4c871 100644 (file)
@@ -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();
 }