[yocto] [PATCH 1/1][meta-selinux] initscripts: fix contexts for /etc/resolv.conf, adjtime

wenzong.fan at windriver.com wenzong.fan at windriver.com
Thu Jul 9 00:59:23 PDT 2015


From: Wenzong Fan <wenzong.fan at windriver.com>

Restore contexts for /etc/{resolv.conf, adjtime}, they are created
dynamically and the incorrect contexts maybe prevent some programs
from valid accessing.

  /etc/resolv.conf: etc_t:SystemHigh -> etc_t:SystemLow
  /etc/adjtime:     etc_t:SystemHigh -> adjtime_t:SystemLow

Signed-off-by: Wenzong Fan <wenzong.fan at windriver.com>
---
 recipes-core/initscripts/initscripts_1.0.bbappend | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/recipes-core/initscripts/initscripts_1.0.bbappend b/recipes-core/initscripts/initscripts_1.0.bbappend
index 462db6f..f17cf07 100644
--- a/recipes-core/initscripts/initscripts_1.0.bbappend
+++ b/recipes-core/initscripts/initscripts_1.0.bbappend
@@ -5,7 +5,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 do_install_append () {
 	cat <<-EOF >> ${D}${sysconfdir}/init.d/populate-volatile.sh
 touch /var/log/lastlog
-test ! -x /sbin/restorecon || /sbin/restorecon -RF /var/volatile/ /var/lib /run
+test ! -x /sbin/restorecon || /sbin/restorecon -RF /var/volatile/ /var/lib /run \
+    /etc/resolv.conf /etc/adjtime
 EOF
 	sed -i '/mount -n -o remount,$rootmode/i\test ! -x /sbin/restorecon || /sbin/restorecon -RF /run' \
 	    ${D}${sysconfdir}/init.d/checkroot.sh
-- 
1.9.1




More information about the yocto mailing list