From 11346f0b340abf1625433d0900c176a642865be5 Mon Sep 17 00:00:00 2001 From: Benedikt Trefzer Date: Mon, 5 Jul 2021 13:17:25 +0200 Subject: [PATCH] use File.chown, instead of File.send Co-authored-by: Ewoud Kohl van Wijngaarden --- lib/puppet/provider/openssl.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/puppet/provider/openssl.rb b/lib/puppet/provider/openssl.rb index b9022aed..cbd3cf91 100644 --- a/lib/puppet/provider/openssl.rb +++ b/lib/puppet/provider/openssl.rb @@ -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 @@ -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 @@ -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