summaryrefslogtreecommitdiffstats
path: root/lib/puppet/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/config.rb')
-rw-r--r--lib/puppet/config.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/config.rb b/lib/puppet/config.rb
index 303c45ed9..5519138fd 100644
--- a/lib/puppet/config.rb
+++ b/lib/puppet/config.rb
@@ -545,7 +545,13 @@ Generated on #{Time.now}.
raise ArgumentError, "Default %s is not a file" % default
end
- Puppet::Util.asuser(obj.owner, obj.group) do
+ chown = nil
+ if Process.uid == 0
+ chown = [obj.owner, obj.group]
+ else
+ chown = [nil, nil]
+ end
+ Puppet::Util.asuser(*chown) do
mode = obj.mode || 0640
if args.empty?