summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorGeorge McCollister <george.mccollister@gmail.com>2015-11-05 10:56:54 -0600
committerJoe MacDonald <joe_macdonald@mentor.com>2015-11-27 09:18:14 -0500
commitd3efe540851c37de277e864e436dcfc0ae9465c5 (patch)
treed81660a92c9f9ee81f181f64cfc3b8241fbd28ba /classes
parent8864246d33150a88f351f2a07815bd02799de549 (diff)
downloadmeta-selinux-d3efe540851c37de277e864e436dcfc0ae9465c5.tar.gz
selinux-image: Fix RE error getting POL_TYPE
Change [:space:] to [[:space:]]. [:space:] is incorrect and is treated as a list of characters. Prior to this change having a policy of 'standard' resulted in POL_TYPE being set to 'tandard'. Change the regular expression to match from the beginning of the line since correcting the [:space:] error causes the '# SELINUXTYPE= can take one of these values:' line to match. Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/selinux-image.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/classes/selinux-image.bbclass b/classes/selinux-image.bbclass
index 362ca5c..9303610 100644
--- a/classes/selinux-image.bbclass
+++ b/classes/selinux-image.bbclass
@@ -1,5 +1,5 @@
1selinux_set_labels () { 1selinux_set_labels () {
2 POL_TYPE=$(sed -n -e "s&SELINUXTYPE[:space:]*=[:space:]*\([0-9A-Za-z_]\+\)&\1&p" ${IMAGE_ROOTFS}/${sysconfdir}/selinux/config) 2 POL_TYPE=$(sed -n -e "s&^SELINUXTYPE[[:space:]]*=[[:space:]]*\([0-9A-Za-z_]\+\)&\1&p" ${IMAGE_ROOTFS}/${sysconfdir}/selinux/config)
3 setfiles -r ${IMAGE_ROOTFS} ${IMAGE_ROOTFS}/${sysconfdir}/selinux/${POL_TYPE}/contexts/files/file_contexts ${IMAGE_ROOTFS} || exit 1; 3 setfiles -r ${IMAGE_ROOTFS} ${IMAGE_ROOTFS}/${sysconfdir}/selinux/${POL_TYPE}/contexts/files/file_contexts ${IMAGE_ROOTFS} || exit 1;
4} 4}
5 5