I think this might be a bug.
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
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 11 lines · Daniel J Walsh
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
Quoted 7 lines
#!/usr/bin/python
from tempfile import mkdtemp
import selinux, osselinux.setfscreatecon("staff_u:object_r:sandbox_x_file_t:s0:c1")homedir =mkdtemp(dir="~/.sandbox", prefix=".sandbox")printselinux.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.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 20 lines · Stephen Smalley
Quoted 11 lines · Daniel J Walsh
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
Quoted 7 lines
#!/usr/bin/python
from tempfile import mkdtemp
import selinux, osselinux.setfscreatecon("staff_u:object_r:sandbox_x_file_t:s0:c1")homedir =mkdtemp(dir="~/.sandbox", prefix=".sandbox")printselinux.getfscreatecon()
print homedir
Quoted 3 lines
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
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 25 lines · Stephen Smalley
Quoted 20 lines · Stephen Smalley
Quoted 11 lines · Daniel J Walsh
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
Quoted 7 lines
#!/usr/bin/python
from tempfile import mkdtemp
import selinux, osselinux.setfscreatecon("staff_u:object_r:sandbox_x_file_t:s0:c1")homedir =mkdtemp(dir="~/.sandbox", prefix=".sandbox")printselinux.getfscreatecon()
print homedirQuoted 3 lines
kernel version?
setfscreatecon()should work unless the filesystem does not support security labeling, and should override any default transitions in the policy.
Quoted 6 lines
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.