summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongsun Lee <ds73.lee@samsung.com>2016-04-12 21:43:07 +0900
committerDongsun Lee <ds73.lee@samsung.com>2016-04-15 14:50:42 +0900
commit51dd3e96c25a118e23f3f90309309531ba7ada3f (patch)
tree6a91e199a5c081ea951abe6f5169cc41969dcc28
parent93bfb81f4a2be32c7cb47832d14af70cc8e0689c (diff)
downloadcert-checker-accepted/tizen/ivi/20160419.050238.tar.gz
cert-checker-accepted/tizen/ivi/20160419.050238.tar.bz2
cert-checker-accepted/tizen/ivi/20160419.050238.zip
Change-Id: I394228947a672e9e6a6c0110bd8fb8cdaae66060 Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
-rw-r--r--CMakeLists.txt1
-rw-r--r--packaging/cert-checker.spec16
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/logic.cpp3
-rw-r--r--systemd/cert-checker.service2
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/dbfixture.cpp5
7 files changed, 17 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7912876..f5ba424 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,7 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
# Enable popup
ADD_DEFINITIONS("-DPOPUP=1")
+ADD_DEFINITIONS("-DDB_INSTALL_DIR=\"${DB_INSTALL_DIR}\"")
SET(TARGET_CERT_CHECKER "cert-checker")
SET(TARGET_CERT_CHECKER_POPUP "cert-checker-popup")
diff --git a/packaging/cert-checker.spec b/packaging/cert-checker.spec
index 7aa48ce..0b71119 100644
--- a/packaging/cert-checker.spec
+++ b/packaging/cert-checker.spec
@@ -23,12 +23,15 @@ BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: boost-devel
+Requires: security-config
%global TZ_SYS_DB %{?TZ_SYS_DB:%TZ_SYS_DB}%{!?TZ_SYS_DB:/opt/dbspace}
%global TZ_SYS_ROOT %{?TZ_SYS_ROOT:%TZ_SYS_ROOT}%{!?TZ_SYS_ROOT:/root}
%global TZ_SYS_RO_SHARE %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
%global TZ_SYS_BIN %{?TZ_SYS_BIN:%TZ_SYS_BIN}%{!?TZ_SYS_BIN:/usr/bin}
+%global DB_INST_DIR %{TZ_SYS_DB}/cert-checker
+
%description
Cert-checker
@@ -51,7 +54,7 @@ export FFLAGS="$FFLAGS"
export LDFLAGS+="-Wl,--rpath=%{_libdir} "
%cmake . -DVERSION=%{version} \
- -DDB_INSTALL_DIR=%{TZ_SYS_DB} \
+ -DDB_INSTALL_DIR=%{DB_INST_DIR} \
-DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DTEST_APP_SIGNATURES_DIR="%{TZ_SYS_ROOT}/cert-checker-test" \
@@ -61,6 +64,7 @@ make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{DB_INST_DIR}
mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/license
cp LICENSE %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name}
%make_install
@@ -85,7 +89,8 @@ if [ $1 = 2 ]; then
# update
systemctl restart cert-checker.service
fi
-chsmack -a System %{TZ_SYS_DB}/.cert-checker.db
+chsmack -a System %{DB_INST_DIR}
+chsmack -a System %{DB_INST_DIR}/.cert-checker.db
%preun
if [ $1 = 0 ]; then
@@ -105,15 +110,16 @@ fi
%{TZ_SYS_BIN}/cert-checker-popup
%manifest %{TZ_SYS_RO_SHARE}/%{name}.manifest
%{TZ_SYS_RO_SHARE}/license/%{name}
-%config(noreplace) %attr(0600,root,root) %{TZ_SYS_DB}/.cert-checker.db
+%dir %attr(0600,security_fw,security_fw) %{DB_INST_DIR}
+%config(noreplace) %attr(0600,security_fw,security_fw) %{DB_INST_DIR}/.cert-checker.db
%{_unitdir}/cert-checker.service
%{_unitdir}/multi-user.target.wants/cert-checker.service
%files -n cert-checker-tests
%license LICENSE.BSL-1.0
-%defattr(-,root,root,-)
+%defattr(-,security_fw,security_fw,-)
%{TZ_SYS_BIN}/cert-checker-tests
%{TZ_SYS_BIN}/cert-checker-tests-logic
%{TZ_SYS_BIN}/cert-checker-popup-test
-%{TZ_SYS_DB}/.cert-checker-test.db
+%{DB_INST_DIR}/.cert-checker-test.db
%{TZ_SYS_ROOT}/cert-checker-test/*/*.xml
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d82a51b..568f553 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -10,7 +10,6 @@ PKG_CHECK_MODULES(CERT_CHECKER_DEP
icu-i18n
key-manager
libsystemd-journal
- libtzplatform-config
sqlite3
pkgmgr
pkgmgr-info
diff --git a/src/logic.cpp b/src/logic.cpp
index 6865ef1..181ebea 100644
--- a/src/logic.cpp
+++ b/src/logic.cpp
@@ -20,7 +20,6 @@
* @brief This file is the implementation of SQL queries
*/
#include <stdexcept>
-#include <tzplatform_config.h>
#include <cchecker/logic.h>
#include <cchecker/log.h>
@@ -70,7 +69,7 @@ struct PkgmgrinfoEvent {
};
std::set<PkgmgrinfoEvent> pkgmgrinfo_event_set;
-const char *const DB_PATH = tzplatform_mkpath(TZ_SYS_DB, ".cert-checker.db");
+const char *const DB_PATH = DB_INSTALL_DIR"/.cert-checker.db";
}
Logic::~Logic(void)
diff --git a/systemd/cert-checker.service b/systemd/cert-checker.service
index 319292b..ab744c9 100644
--- a/systemd/cert-checker.service
+++ b/systemd/cert-checker.service
@@ -3,6 +3,8 @@ Description=Start the Cert-Checker
Requires=dbus.service
[Service]
+User=security_fw
+Group=security_fw
EnvironmentFile=-/etc/sysconfig/enlightenment
# Makes popup bigger
Environment="ELM_SCALE=4.0"
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c8d51f9..fa2817a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -10,7 +10,6 @@ PKG_CHECK_MODULES(CERT_CHECKER_TESTS_DEP
icu-i18n
key-manager
libsystemd-journal
- libtzplatform-config
sqlite3
pkgmgr
pkgmgr-info
diff --git a/tests/dbfixture.cpp b/tests/dbfixture.cpp
index 2e99009..4d604fe 100644
--- a/tests/dbfixture.cpp
+++ b/tests/dbfixture.cpp
@@ -20,7 +20,6 @@
* @brief Implementation of DB test class
*/
#include <boost/test/unit_test.hpp>
-#include <tzplatform_config.h>
#include <fstream>
#include <dbfixture.h>
@@ -28,8 +27,8 @@
using namespace CCHECKER;
namespace {
-const char *TEST_DB_PATH = tzplatform_mkpath(TZ_SYS_DB, ".cert-checker-test.db");
-const char *TEST_DB_PATH_TEMP = tzplatform_mkpath(TZ_SYS_DB, ".cert-checker-test-temp.db");
+const char *TEST_DB_PATH = DB_INSTALL_DIR"/.cert-checker-test.db" ;
+const char *TEST_DB_PATH_TEMP = DB_INSTALL_DIR"/.cert-checker-test-temp.db";
} // anonymus namespace
DBFixture::DBFixture() :