PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/file/ |
| Server: Linux server1.ngambekcore.com 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 04:00:07 EDT 2025 x86_64 IP: 159.198.77.92 |
| Dir : //opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/file/owner.rb |
module Puppet
Puppet::Type.type(:file).newproperty(:owner) do
include Puppet::Util::Warnings
desc <<-EOT
The user to whom the file should belong. Argument can be a user name or a
user ID.
On Windows, a group (such as "Administrators") can be set as a file's owner
and a user (such as "Administrator") can be set as a file's group; however,
a file's owner and group shouldn't be the same. (If the owner is also
the group, files with modes like `"0640"` will cause log churn, as they
will always appear out of sync.)
EOT
def insync?(current)
# We don't want to validate/munge users until we actually start to
# evaluate this property, because they might be added during the catalog
# apply.
@should.map! do |val|
uid = provider.name2uid(val)
if uid
uid
elsif provider.resource.noop?
return false
else
raise "Could not find user #{val}"
end
end
return true if @should.include?(current)
unless Puppet.features.root?
warnonce "Cannot manage ownership unless running as root"
return true
end
false
end
# We want to print names, not numbers
def is_to_s(currentvalue)
super(provider.uid2name(currentvalue) || currentvalue)
end
def should_to_s(newvalue)
super(provider.uid2name(newvalue) || newvalue)
end
end
end