Skip to content

Commit

Permalink
use File.chown, instead of File.send
Browse files Browse the repository at this point in the history
Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
  • Loading branch information
trefzer and ekohl committed Jul 5, 2021
1 parent 632eece commit bd05228
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/puppet/provider/openssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def owner
end

def owner=(should)
File.send(:chown, uid(should), nil, resource[:path])
File.chown(uid(should), nil, resource[:path])
rescue => detail
raise Puppet::Error, _("Failed to set owner to '%{should}': %{detail}") % { should: should, detail: detail }, detail.backtrace
end
Expand All @@ -27,7 +27,7 @@ def group
end

def group=(should)
File.send(:chown, nil, gid(should), resource[:path])
File.chown(nil, gid(should), resource[:path])
rescue => detail
raise Puppet::Error, _("Failed to set group to '%{should}': %{detail}") % { should: should, detail: detail }, detail.backtrace
end
Expand All @@ -47,8 +47,8 @@ def mode=(should)
end

def set_file_perm(filename, owner = nil, group = nil, mode = nil)
File.send(:chown, uid(owner), nil, filename) if owner
File.send(:chown, nil, gid(group), filename) if group
File.chown(uid(owner), nil, resource[:path]) if owner
File.chown(nil, gid(group), resource[:path]) if group
File.chmod(Integer('0' + mode), filename) if mode
end
end

0 comments on commit bd05228

Please sign in to comment.