initscripts/devpts.sh: fix context for /dev/pts

devpts use file_use_trans to allocate security contexts. As there are no
range_trans rules for initrc_t mounting devpts, the security level of
mountpoint will be derived from the initrc process, to be systemhigh
(s15:c0.c1023), instead of expected systemlow(s0).

This will block login shells to search PTYs, so use restorecon to fix
this.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
This commit is contained in:
Wenzong Fan 2014-05-12 03:31:49 -04:00 committed by Xin Ouyang
parent f48a8184d0
commit 073ce40add

View File

@ -24,5 +24,6 @@ then
then
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts -ogid=${TTYGRP},mode=${TTYMODE}
test ! -x /sbin/restorecon || /sbin/restorecon -F /dev/pts
fi
fi