All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Daniel J Walsh <dwalsh@redhat.com>,
	SELinux <selinux@tycho.nsa.gov>,
	Eric Paris <eparis@parisplace.org>,
	James Morris <jmorris@namei.org>
Subject: Re: I think this might be a bug.
Date: Thu, 04 Mar 2010 23:34:47 -0500	[thread overview]
Message-ID: <1267763687.2658.0.camel@localhost> (raw)
In-Reply-To: <1267735127.23761.184.camel@moss-pluto.epoch.ncsc.mil>

On Thu, 2010-03-04 at 15:38 -0500, Stephen Smalley wrote: 
> On Thu, 2010-03-04 at 15:24 -0500, Stephen Smalley wrote:
> > On Thu, 2010-03-04 at 13:40 -0500, Daniel J Walsh wrote:
> > > If I have a program that calls setfscreatecon on a directory that has a 
> > > transition, the transition rule wins.  I think the setfscreatecon should 
> > > win.
> > > 
> > > Sandbox creates a .sandboxRANDOM directory in the current working 
> > > directory with setfscreatecon, If I do this in ~dwalsh  It does not 
> > > work.  If I do it in ~dwalsh/.sandbox or /tmp or any directory other 
> > > then my homedir toplevel it works.
> > > 
> > > Here is a python script that shows the behaviour
> > > 
> > > #!/usr/bin/python
> > > from tempfile import mkdtemp
> > > import selinux, os
> > > selinux.setfscreatecon("staff_u:object_r:sandbox_x_file_t:s0:c1")
> > > homedir = mkdtemp(dir="~/.sandbox", prefix=".sandbox")
> > > print selinux.getfscreatecon()
> > > print homedir
> > 
> > kernel version?  setfscreatecon() should work unless the filesystem does
> > not support security labeling, and should override any default
> > transitions in the policy. 
> 
> Confirmed on ext4; seems to work correctly on ext3.
> 
> Your python script didn't work for me, but this much simpler test does:
> cd $HOME
> mkdir -Z unconfined_u:object_r:etc_t:s0 bar
> ls -Zd bar

I'm out on Friday, but I know someone else inside Red Hat was able to
reproduce issues.  I'm going to run it down on monday, but don't be
surprised if you see something from dave airlie about this issue....

thanks

-Eric


--
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.

      reply	other threads:[~2010-03-05  4:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 18:40 I think this might be a bug Daniel J Walsh
2010-03-04 20:24 ` Stephen Smalley
2010-03-04 20:38   ` Stephen Smalley
2010-03-05  4:34     ` Eric Paris [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=1267763687.2658.0.camel@localhost \
    --to=eparis@redhat.com \
    --cc=dwalsh@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --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.