Fix access to security_test_user directory. 33/155933/1
authorDariusz Michaluk <d.michaluk@samsung.com>
Mon, 16 Oct 2017 12:06:52 +0000 (14:06 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Mon, 16 Oct 2017 12:09:05 +0000 (14:09 +0200)
Change-Id: I0fbb57bae137d4d2c7804b9f5151c6a8ff8697a7

packaging/security-tests.spec

index f815452..709a3e6 100644 (file)
@@ -63,14 +63,15 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
         -DLOCAL_APP_DIR="%{TZ_SYS_HOME}/security_test_user/apps_rw"
 make %{?jobs:-j%jobs}
 
+%pre
+id -u  security_test_user 1>/dev/null 2>&1 || \
+    gum-utils -o -a --username=security_test_user --usertype=normal
+
 %install
 %make_install
 ln -sf /etc/smack/test_smack_rules %{buildroot}/etc/smack/test_smack_rules_lnk
 
 %post
-id -u  security_test_user 1>/dev/null 2>&1 || \
-    gum-utils -o -a --username=security_test_user --usertype=normal
-
 # Reload dbus daemon to apply newly installed configuration
 systemctl reload dbus
 
@@ -94,7 +95,7 @@ echo "security-tests postinst done ..."
 /etc/smack/test_smack_rules
 /etc/smack/test_smack_rules_lnk
 %{TZ_SYS_RW_APP}*
-%{TZ_SYS_HOME}/security_test_user/apps_rw/*
+%attr(755, security_test_user,users) %{TZ_SYS_HOME}/security_test_user/apps_rw/*
 /usr/bin/cynara-test
 /usr/bin/ckm-tests
 /usr/bin/ckm-integration-tests