From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: LC Bruzenak <lenny@MagitekLtd.com>,
SE-Linux <selinux@tycho.nsa.gov>,
Joshua Brindle <jbrindle@tresys.com>
Subject: Re: semanage help
Date: Thu, 23 Oct 2008 13:10:52 -0400 [thread overview]
Message-ID: <4900B01C.4070206@redhat.com> (raw)
In-Reply-To: <1224779343.28867.60.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
> On Thu, 2008-10-23 at 12:05 -0400, Daniel J Walsh wrote:
>> Stephen Smalley wrote:
>>> On Wed, 2008-10-22 at 21:06 -0500, LC Bruzenak wrote:
>>>> - get the file context -
>>>> [root@v1 ~]# semanage fcontext -l | grep prelude_spool
>>>> /var/spool/prelude(/.*)? all files system_u:object_r:prelude_spool_t:s0
>>>> /var/spool/prelude-manager(/.*)? all files system_u:object_r:prelude_spool_t:s0
>>>>
>>>> So it seems that it knows about this path match.
>>>>
>>>> - set the file range -
>>>> [root@v1 ~]# semanage fcontext -m -r s15:c0.c1023 "/var/spool/prelude(/.*)?"
>>>> /usr/sbin/semanage: File context for /var/spool/prelude(/.*)? is not defined
>>>>
>>>> [root@v1 ~]# semanage fcontext -m -r s15:c0.c1023 -t prelude_spool_t '/var/spool/prelude(/.*)?'
>>>> /usr/sbin/semanage: File context for /var/spool/prelude(/.*)? is not defined
>>>>
>>>> Can someone tell me what I'm doing wrong/how to fix?
>>> Looks like it is defined by a policy module, and semanage fcontext -m
>>> can only modify local definitions.
>>>
>>> I'd think that you could add a local definition to override it, ala:
>>> /usr/sbin/semanage fcontext -a -t prelude_spool_t -r s15:c0.c1023 '/var/spool/prelude(/.*)?'
>>>
>>> but that complains that it already exists. Maybe it ought to be using
>>> semanage_fcontext_exists_local() instead?
>>>
>> Making that change ends up with and using postgrey instead of prelude.
>>
>>
>> # /usr/sbin/semanage fcontext -a -t postgrey_spool_t -r s0:c0.c1023
>> '/var/spool/postfix/postgrey(/.*)?'
>
> Not sure I understand - the command I ran above was for prelude_spool_t
> and /var/spool/prelude, not postgrey. Anyway, I thought we moved the
> nodups_specs() check before reading of file_contexts.local so that local
> specs could in fact override/duplicate base file_contexts. In
> libselinux 2.0.71.
>> /sbin/restorecon -r -v /var/spool/posfix/postgrey
>> /etc/selinux/targeted/contexts/files/file_contexts: Multiple different
>> specifications for /var/spool/postfix/postgrey(/.*)?
>> (system_u:object_r:postgrey_spool_t:s0:c0.c1023 and
>> system_u:object_r:postgrey_spool_t:s0).
>>
>>
Did testing on Fedora 9 which did not have prelude installed, so I
changed, it for the test
# rpm -q libselinux
libselinux-2.0.67-4.fc9.x86_64
libselinux-2.0.67-4.fc9.i386
On Rawhide it seems to work
# /usr/sbin/semanage fcontext -a -t prelude_spool_t -r s0:c0.c1023
'/var/spool/prelude(/.*)?'
# restorecon -R -v /var/spool/prelude/
restorecon reset /var/spool/prelude context
system_u:object_r:prelude_spool_t:s0->system_u:object_r:prelude_spool_t:s0:c0.c1023
So I will patch policycoreutils.
--
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:[~2008-10-23 17:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-23 2:06 semanage help LC Bruzenak
2008-10-23 12:53 ` Stephen Smalley
2008-10-23 16:05 ` Daniel J Walsh
2008-10-23 16:29 ` Stephen Smalley
2008-10-23 17:10 ` Daniel J Walsh [this message]
2008-10-23 17:18 ` LC Bruzenak
2008-10-23 17:29 ` Daniel J Walsh
2008-10-23 18:00 ` Stephen Smalley
2008-10-23 18:41 ` LC Bruzenak
2008-10-23 18:48 ` Stephen Smalley
2008-10-30 18:31 ` Daniel J Walsh
2008-10-30 18:37 ` Joshua Brindle
2008-10-30 19:36 ` Daniel J Walsh
2008-10-31 1:26 ` LC Bruzenak
2008-10-23 17:26 ` Daniel J Walsh
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=4900B01C.4070206@redhat.com \
--to=dwalsh@redhat.com \
--cc=jbrindle@tresys.com \
--cc=lenny@MagitekLtd.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.