From: Cory Olmo <colmo@TrustedCS.com>
To: James Morris <jmorris@namei.org>
Cc: selinux@tycho.nsa.gov
Subject: Re: [RFC Patch 1/3] Context Mounts and Unsupported Contexts: kernel
Date: Tue, 15 Aug 2006 15:49:14 -0500 [thread overview]
Message-ID: <20060815154914.3ee6b06b.colmo@TrustedCS.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0608151521300.32340@d.namei>
On Tue, 15 Aug 2006 15:21:48 -0400
James Morris <jmorris@namei.org> wrote:
> On Tue, 15 Aug 2006, Cory Olmo wrote:
>
> > This patch modifies selinux_sb_copy_data() so that it will only take
> an
> > option after seeing a ',' if it hasn't seen a quote or if the quotes
> are
> > matched.
>
>
> Why?
Sorry the wording was poor on this one. The goal is to allow the context
portion of the option data to contain commas. To do that I went with
quoting the context. In order for the quoted context to be taken as a
single option, selinux_sb_copy_data() needed to know when it had seen an
opening quote and be able to hold off on taking the option until it had
seen the closing quote.
This patch modifies selinux_sb_copy_data() to mark a flag value when it runs
across a '"'. This flag value is consulted each time a comma is
encountered. If the flag indicates that the current option has an embedded
quote it will move on to the next character. If the flag indicates that
there is either a matched set of quotes or no quotes at all then the option
can be taken. If the option happens to be an selinux option then the new
routine take_selinux_option() is called. take_selinux_option() will copy the
option to the previously allocated selinux data page. While it is doing the
copying it will skip any quotes present in the option so the data page contains
only the raw unquoted context. The previously used comma separator between
options in the selinux data page is also replaced with a '|' character which
allows try_context_mount() to properly extract whole context option strings
as well.
>
>
> --
> James Morris
> <jmorris@namei.org>
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-08-15 20:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-15 15:56 [RFC Patch 1/3] Context Mounts and Unsupported Contexts: kernel Cory Olmo
2006-08-15 19:21 ` James Morris
2006-08-15 20:49 ` Cory Olmo [this message]
2006-08-16 13:58 ` James Morris
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=20060815154914.3ee6b06b.colmo@TrustedCS.com \
--to=colmo@trustedcs.com \
--cc=jmorris@namei.org \
--cc=selinux@tycho.nsa.gov \
/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.