summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2020-06-02 17:42:55 -0700
committerPete Higgins <pete@peterhiggins.org>2020-06-03 11:46:53 -0700
commit6e81130508423bd94759e66b1b9099d76a23fdf7 (patch)
tree6f0b29f30b6a1f351f111b26f3b63397b80b7441
parent0e8e9aefd262b4849c5f908715d0c819ba8d642d (diff)
downloadchef-6e81130508423bd94759e66b1b9099d76a23fdf7.tar.gz
Remove unix code from WindowsScript.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r--lib/chef/provider/windows_script.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/chef/provider/windows_script.rb b/lib/chef/provider/windows_script.rb
index 0334a84150..4a17a6ff1a 100644
--- a/lib/chef/provider/windows_script.rb
+++ b/lib/chef/provider/windows_script.rb
@@ -67,18 +67,6 @@ class Chef
"\"#{interpreter}\" #{flags} \"#{script_file_path}\""
end
- def set_owner_and_group(file_path)
- if ChefUtils.windows?
- # And on Windows also this is a no-op if there is no user specified.
- grant_alternate_user_read_access(file_path)
- else
- # FileUtils itself implements a no-op if +user+ or +group+ are nil
- # You can prove this by running FileUtils.chown(nil,nil,'/tmp/file')
- # as an unprivileged user.
- FileUtils.chown(new_resource.user, new_resource.group, file_path)
- end
- end
-
def grant_alternate_user_read_access(file_path)
# Do nothing if an alternate user isn't specified -- the file
# will already have the correct permissions for the user as part
@@ -114,7 +102,7 @@ class Chef
script_file.puts(code)
script_file.close
- set_owner_and_group(script_file.path)
+ grant_alternate_user_read_access(script_file.path)
# This needs to be set here so that the call to #command in Execute works.
self.script_file_path = script_file.path