diff options
author | Markus Roberts <Markus@reality.com> | 2010-06-09 17:47:39 -0700 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 2396ebac9021eaa4a2983e60902c04cc9e0db0ee (patch) | |
tree | 05015dc5d67aca35dd235a6229fb360ecb6b68e9 /lib/puppet | |
parent | 8128311690a25d864087a7aee31b233a459345fd (diff) | |
download | puppet-2396ebac9021eaa4a2983e60902c04cc9e0db0ee.tar.gz puppet-2396ebac9021eaa4a2983e60902c04cc9e0db0ee.tar.xz puppet-2396ebac9021eaa4a2983e60902c04cc9e0db0ee.zip |
Use the 'root' feature rather than directly checking the uid
Jesse fixed all these but David and others moved them and introduced some more so...
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/provider/file/posix.rb | 2 | ||||
-rw-r--r-- | lib/puppet/provider/file/win32.rb | 2 | ||||
-rwxr-xr-x | lib/puppet/type/file/source.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/provider/file/posix.rb b/lib/puppet/provider/file/posix.rb index 6d6e2312b..43b745d37 100644 --- a/lib/puppet/provider/file/posix.rb +++ b/lib/puppet/provider/file/posix.rb @@ -42,7 +42,7 @@ Puppet::Type.type(:file).provide :posix do return true if uid == current end - unless Puppet::Util::SUIDManager.uid == 0 + unless Puppet.features.root? warnonce "Cannot manage ownership unless running as root" return true end diff --git a/lib/puppet/provider/file/win32.rb b/lib/puppet/provider/file/win32.rb index 8eeef4415..b19bd0c5a 100644 --- a/lib/puppet/provider/file/win32.rb +++ b/lib/puppet/provider/file/win32.rb @@ -29,7 +29,7 @@ Puppet::Type.type(:file).provide :win32 do return true if uid == current end - unless Puppet::Util::SUIDManager.uid == 0 + unless Puppet.features.root? warnonce "Cannot manage ownership unless running as root" return true end diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb index cf861a0df..aaf91695c 100755 --- a/lib/puppet/type/file/source.rb +++ b/lib/puppet/type/file/source.rb @@ -104,7 +104,7 @@ module Puppet # if a value has not already been provided. [:owner, :mode, :group, :checksum].each do |metadata_method| param_name = (metadata_method == :checksum) ? :content : metadata_method - next if metadata_method == :owner and Puppet::Util::SUIDManager.uid != 0 + next if metadata_method == :owner and !Puppet.features.root? next if metadata_method == :checksum and metadata.ftype == "directory" if resource[param_name].nil? or resource[param_name] == :absent |