From: Philip Tricca <flihp@twobit.us>
To: George McCollister <george.mccollister@gmail.com>
Cc: yocto@yoctoproject.org
Subject: Re: [meta-selinux][PATCH] selinux-image: Fix RE error getting POL_TYPE
Date: Sun, 08 Nov 2015 11:09:21 -0800 [thread overview]
Message-ID: <563F9DE1.9010706@twobit.us> (raw)
In-Reply-To: <1446742614-8298-1-git-send-email-george.mccollister@gmail.com>
On 11/05/2015 08:56 AM, George McCollister wrote:
> 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'.
Good catch.
> 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.
You may want to add an additional [[:space:]]* between the '^' and
'SELINUXTYPE' to allow for valid whitespace but that's cosmetic. I'd say
pull it either way.
Best,
Philip
> Signed-off-by: George McCollister <george.mccollister@gmail.com>
> ---
> classes/selinux-image.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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 @@
> selinux_set_labels () {
> - POL_TYPE=$(sed -n -e "s&SELINUXTYPE[:space:]*=[:space:]*\([0-9A-Za-z_]\+\)&\1&p" ${IMAGE_ROOTFS}/${sysconfdir}/selinux/config)
> + POL_TYPE=$(sed -n -e "s&^SELINUXTYPE[[:space:]]*=[[:space:]]*\([0-9A-Za-z_]\+\)&\1&p" ${IMAGE_ROOTFS}/${sysconfdir}/selinux/config)
> setfiles -r ${IMAGE_ROOTFS} ${IMAGE_ROOTFS}/${sysconfdir}/selinux/${POL_TYPE}/contexts/files/file_contexts ${IMAGE_ROOTFS} || exit 1;
> }
>
>
prev parent reply other threads:[~2015-11-08 19:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 16:56 [meta-selinux][PATCH] selinux-image: Fix RE error getting POL_TYPE George McCollister
2015-11-08 19:09 ` Philip Tricca [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563F9DE1.9010706@twobit.us \
--to=flihp@twobit.us \
--cc=george.mccollister@gmail.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.