Fix /etc/hosts SELinux file context

/etc/hosts is modified and ends up having the wrong SELinux file
context. Run restorecon to correct it.

Change-Id: I07da602db49b0f122a86a95b5dc5d294fc95ce5c
Closes-Bug: 1344417
This commit is contained in:
Richard Su 2014-07-18 15:04:15 -07:00
parent c7d5246a75
commit a7b223aaa2
1 changed files with 5 additions and 0 deletions

View File

@ -17,3 +17,8 @@ echo >> /var/run/hosts.d/new-hosts
cat /var/run/hosts.d/tail >> /var/run/hosts.d/new-hosts
echo >> /var/run/hosts.d/new-hosts
mv /var/run/hosts.d/new-hosts /etc/hosts
# /etc/hosts may have the wrong SELinux file contexts.
if [ -x /usr/sbin/semanage ]; then
restorecon -v /etc/hosts
fi