diff options
author | Thom May <thom@chef.io> | 2015-05-05 17:49:19 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2015-05-05 17:49:19 +0100 |
commit | 25e05528231b32ed181f57c983d9a8161564571e (patch) | |
tree | 55e70ed926278115f492bca95b97df86ace5adb0 /spec/support/shared/functional | |
parent | 8c92948746bc418fac09218814a9cfb9e4894b5d (diff) | |
parent | 7204f72e91235fd52c6a97ed3169d31caf7235d1 (diff) | |
download | chef-25e05528231b32ed181f57c983d9a8161564571e.tar.gz |
Merge branch 'minshallj/keep_suid_bit' of https://github.com/minshallj/chef into minshallj-minshallj/keep_suid_bit
Diffstat (limited to 'spec/support/shared/functional')
-rw-r--r-- | spec/support/shared/functional/securable_resource.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index e016bb685d..2af6ef3a67 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -231,6 +231,24 @@ shared_examples_for "a securable resource with existing target" do expect(resource.updated_by_last_action?).to eq(expect_updated?) end end + + describe "when setting the suid bit", :requires_root do + before do + @suid_mode = 04776 + resource.mode @suid_mode + resource.run_action(:create) + end + + it "should set the suid bit" do + expect(File.lstat(path).mode & 007777).to eq(@suid_mode & 007777) + end + + it "should retain the suid bit when updating the user" do + resource.user 1338 + resource.run_action(:create) + expect(File.lstat(path).mode & 007777).to eq(@suid_mode & 007777) + end + end end context "on Windows", :windows_only do |