From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Joshua Brindle <jbrindle@tresys.com>, SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Problem with semanage, looks like we don't handle the <<none>> context type?
Date: Wed, 01 Aug 2007 09:00:15 -0400 [thread overview]
Message-ID: <46B083DF.6010400@redhat.com> (raw)
In-Reply-To: <1185971344.15215.247.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
> On Tue, 2007-07-31 at 16:57 -0400, Daniel J Walsh wrote:
>
>> Joshua Brindle wrote:
>>
>>> Daniel J Walsh wrote:
>>>
>>>> cat /tmp/test.py
>>>> #!/usr/bin/python
>>>> from semanage import *
>>>> sh = semanage_handle_create()
>>>> rc, con = semanage_context_from_string(sh, "<<none>>")
>>>> rc,fcontext = semanage_fcontext_create(sh)
>>>> semanage_fcontext_set_con(sh, fcontext, con)
>>>>
>>>>
>>>> # python /tmp/test.py
>>>> Segmentation fault
>>>>
>>> Granted the segfault needs to be fixed but what exactly are you trying
>>> to accomplish? <<none>> is not a type, its just something matchpathcon
>>> uses to short circuit its labeling behavior.
>>>
>>>
>> I have a request from someone who wants to setup a directory that
>> shortcuts the labeling behaviour. IE wants restorecon and friends to do
>> nothing in the directory.
>>
>
> libsemanage maps a NULL context to <<none>>.
>
>
Ok if I change the python to not set the context at all, then semanage
does the right thing.
# semanage fcontext -a -t '<<none>>' /data
if type != "<<none>>":
(rc, con) = semanage_context_create(self.sh)
...
rc = semanage_fcontext_set_con(self.sh, fcontext,
con)
Of course the syntax is a bit misleading from a technical point of view
<<none>> is not a type. But it works for me.
--
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:[~2007-08-01 13:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 13:42 Problem with semanage, looks like we don't handle the <<none>> context type? Daniel J Walsh
2007-07-31 20:51 ` Joshua Brindle
2007-07-31 20:57 ` Daniel J Walsh
2007-07-31 20:59 ` Joshua Brindle
2007-07-31 21:08 ` Daniel J Walsh
2007-08-01 12:29 ` Stephen Smalley
2007-08-01 13:00 ` Daniel J Walsh [this message]
2007-08-01 13:42 ` Stephen Smalley
2007-08-01 13:02 ` Stephen Smalley
2007-08-01 13:46 ` Stephen Smalley
2007-08-01 13:57 ` Daniel J Walsh
2007-08-01 14:07 ` Stephen Smalley
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=46B083DF.6010400@redhat.com \
--to=dwalsh@redhat.com \
--cc=jbrindle@tresys.com \
--cc=sds@tycho.nsa.gov \
--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.