summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorSean E. Millichamp <sean@bruenor.org>2008-10-13 16:48:40 -0400
committerJames Turnbull <james@lovedthanlost.net>2008-10-17 08:17:46 +1100
commitdedf0cdce952e36bcdccfc88b1efc33d9f5eaddb (patch)
tree537c0b4392ddf34c0dfc2495e47646ff0318b774 /spec
parent7f5ded185269cabeb7921c4f4739e1f66a34d54d (diff)
downloadpuppet-dedf0cdce952e36bcdccfc88b1efc33d9f5eaddb.tar.gz
puppet-dedf0cdce952e36bcdccfc88b1efc33d9f5eaddb.tar.xz
puppet-dedf0cdce952e36bcdccfc88b1efc33d9f5eaddb.zip
Setting SELinux contexts with chcon should not dereference symbolic links
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/util/selinux.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/util/selinux.rb b/spec/unit/util/selinux.rb
index 1718404e8..2d54d0a46 100644
--- a/spec/unit/util/selinux.rb
+++ b/spec/unit/util/selinux.rb
@@ -117,31 +117,31 @@ describe Puppet::Util::SELinux do
it "should use chcon to set a context" do
self.expects(:selinux_support?).returns true
- self.expects(:system).with("chcon user_u:role_r:type_t:s0 /foo").returns 0
+ self.expects(:system).with("chcon -h user_u:role_r:type_t:s0 /foo").returns 0
set_selinux_context("/foo", "user_u:role_r:type_t:s0").should be_true
end
it "should use chcon to set user_u user context" do
self.expects(:selinux_support?).returns true
- self.expects(:system).with("chcon -u user_u /foo").returns 0
+ self.expects(:system).with("chcon -h -u user_u /foo").returns 0
set_selinux_context("/foo", "user_u", :seluser).should be_true
end
it "should use chcon to set role_r role context" do
self.expects(:selinux_support?).returns true
- self.expects(:system).with("chcon -r role_r /foo").returns 0
+ self.expects(:system).with("chcon -h -r role_r /foo").returns 0
set_selinux_context("/foo", "role_r", :selrole).should be_true
end
it "should use chcon to set type_t type context" do
self.expects(:selinux_support?).returns true
- self.expects(:system).with("chcon -t type_t /foo").returns 0
+ self.expects(:system).with("chcon -h -t type_t /foo").returns 0
set_selinux_context("/foo", "type_t", :seltype).should be_true
end
it "should use chcon to set s0:c3,c5 range context" do
self.expects(:selinux_support?).returns true
- self.expects(:system).with("chcon -l s0:c3,c5 /foo").returns 0
+ self.expects(:system).with("chcon -h -l s0:c3,c5 /foo").returns 0
set_selinux_context("/foo", "s0:c3,c5", :selrange).should be_true
end
end