summaryrefslogtreecommitdiff
path: root/spec/support/shared/functional
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2014-07-11 14:49:29 -0700
committersersut <serdar@opscode.com>2014-07-14 13:18:31 -0700
commit1bef09fa00d55c07095edb21fdc338f1e92956ef (patch)
tree8de871804de9fe87ca988a7880a4e9ee71d0f4d3 /spec/support/shared/functional
parent04612158ac256ce46faad599e141ff7d1161fd66 (diff)
downloadchef-1bef09fa00d55c07095edb21fdc338f1e92956ef.tar.gz
Handle unexpected default non-inheritable ACLs on non-vanilla windows boxes.
Diffstat (limited to 'spec/support/shared/functional')
-rw-r--r--spec/support/shared/functional/securable_resource.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb
index 4efe7a69a1..9999146dee 100644
--- a/spec/support/shared/functional/securable_resource.rb
+++ b/spec/support/shared/functional/securable_resource.rb
@@ -525,16 +525,24 @@ shared_examples_for "a securable resource without existing target" do
it "has the inheritable acls of parent directory if no acl is specified" do
File.exist?(path).should == false
+ # Collect the inheritable acls form the parent by creating a file without
+ # any specific ACLs
parent_acls = parent_inheritable_acls
+ # On certain flavors of Windows the default list of ACLs sometimes includes
+ # non-inherited ACLs. Filter them out here.
+ parent_inherited_acls = parent_acls.dacl.collect do |ace|
+ ace.inherited?
+ end
+
resource.run_action(:create)
- descriptor.dacl.each_with_index do |ace, index|
- # On Windows Server 2003 OS creates a default non-inheritable
- # ACL during file creation unless otherwise specified.
- ace.inherited?.should == true unless windows_win2k3?
- ace.should == parent_acls.dacl[index]
+ # Similarly filter out the non-inherited ACLs
+ resource_inherited_acls = descriptor.dacl.collect do |ace|
+ ace.inherited?
end
+
+ resource_inherited_acls.should == parent_inherited_acls
end
end