change smack label of db files in posttrans script 09/72809/4 accepted/tizen/common/20160607.194645 accepted/tizen/ivi/20160607.235244 accepted/tizen/ivi/20160607.235329 accepted/tizen/mobile/20160607.235227 accepted/tizen/mobile/20160607.235301 accepted/tizen/tv/20160607.235239 accepted/tizen/tv/20160607.235320 accepted/tizen/wearable/20160607.235231 accepted/tizen/wearable/20160607.235311 submit/tizen/20160607.081957 submit/tizen/20160607.082137
authorJiwoong Im <jiwoong.im@samsung.com>
Thu, 2 Jun 2016 11:36:17 +0000 (20:36 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Fri, 3 Jun 2016 05:37:13 +0000 (14:37 +0900)
Change-Id: Icce3597d5f09b4b45427363d2b8c9d1a422f88ad
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
packaging/buxton2.spec

index b0ab267..13ce621 100644 (file)
@@ -1,3 +1,5 @@
+%define dbdir %{_localstatedir}/lib/%{name}
+
 Name:           buxton2
 Version:        1.1
 Release:        0
@@ -21,6 +23,8 @@ Requires(post): /usr/bin/chown
 Requires(post): /usr/sbin/useradd
 Requires(post): /usr/sbin/groupadd
 Requires(post): /usr/bin/chsmack
+Requires(posttrans): /usr/bin/chsmack
+Requires(posttrans): /usr/bin/chmod
 Obsoletes:      buxton
 Provides:       buxton
 
@@ -130,18 +134,22 @@ ln -sf ../%{name}.socket %{buildroot}%{_unitdir}/sockets.target.wants/
 
 %post
 /sbin/ldconfig
-dbdir="%{_localstatedir}/lib/%{name}"
 
 # buxtond runs as user buxton of group buxton
 # create it on need!
 getent group buxton > /dev/null || groupadd -r buxton
-getent passwd buxton > /dev/null || useradd -r -g buxton -d "${dbdir}" buxton
+getent passwd buxton > /dev/null || useradd -r -g buxton -d "%{dbdir}" buxton
 
 # The initial DBs will not have the correct labels and
 # permissions when created in postinstall during image
 # creation, so we set these file attributes here.
-chown -R buxton:buxton "${dbdir}"
-chsmack -a System "${dbdir}"
+chown -R buxton:buxton "%{dbdir}"
+chsmack -a System "%{dbdir}"
+chsmack -t "%{dbdir}"
+
+%posttrans
+chmod 0600 %{dbdir}/*
+chsmack -a System %{dbdir}/*
 
 %postun -p /sbin/ldconfig