summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-23 05:22:01 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-23 05:22:01 +0000
commit9720a9764155b707126c2254fab3fa4d2516b352 (patch)
tree882d47b2bcf62cede3cddaeae93963852b27d47e /lib
parentdb5494fff2fe521d616ba726e9ab2d3bafb94a21 (diff)
downloadpuppet-9720a9764155b707126c2254fab3fa4d2516b352.tar.gz
puppet-9720a9764155b707126c2254fab3fa4d2516b352.tar.xz
puppet-9720a9764155b707126c2254fab3fa4d2516b352.zip
Fixing #436. Also finally renamed pfile/uid.rb to match the state name.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2078 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type/pfile.rb2
-rwxr-xr-xlib/puppet/type/pfile/group.rb21
-rwxr-xr-xlib/puppet/type/pfile/owner.rb (renamed from lib/puppet/type/pfile/uid.rb)27
3 files changed, 28 insertions, 22 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 25d1fbc88..2551106a8 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -1076,7 +1076,7 @@ module Puppet
require 'puppet/type/pfile/source' # can create the file
require 'puppet/type/pfile/target'
require 'puppet/type/pfile/ensure' # can create the file
- require 'puppet/type/pfile/uid'
+ require 'puppet/type/pfile/owner'
require 'puppet/type/pfile/group'
require 'puppet/type/pfile/mode'
require 'puppet/type/pfile/type'
diff --git a/lib/puppet/type/pfile/group.rb b/lib/puppet/type/pfile/group.rb
index 81059db91..fbde811c3 100755
--- a/lib/puppet/type/pfile/group.rb
+++ b/lib/puppet/type/pfile/group.rb
@@ -44,6 +44,19 @@ module Puppet
end
def retrieve
+ if self.should
+ @should = @should.collect do |val|
+ unless val.is_a?(Integer)
+ if tmp = validgroup?(val)
+ val = tmp
+ else
+ raise "Could not find group %s" % val
+ end
+ else
+ val
+ end
+ end
+ end
stat = @parent.stat(false)
unless stat
@@ -72,14 +85,6 @@ module Puppet
return false
end
end
-
- munge do |value|
- if val = validgroup?(value)
- return val
- else
- return value
- end
- end
# Normal users will only be able to manage certain groups. Right now,
# we'll just let it fail, but we should probably set things up so
diff --git a/lib/puppet/type/pfile/uid.rb b/lib/puppet/type/pfile/owner.rb
index 891bd56fd..cca888494 100755
--- a/lib/puppet/type/pfile/uid.rb
+++ b/lib/puppet/type/pfile/owner.rb
@@ -83,6 +83,20 @@ module Puppet
end
def retrieve
+ if self.should
+ @should = @should.collect do |val|
+ unless val.is_a?(Integer)
+ if tmp = validuser?(val)
+ val = tmp
+ else
+ raise "Could not find user %s" % val
+ end
+ else
+ val
+ end
+ end
+ end
+
unless stat = @parent.stat(false)
@is = :absent
return
@@ -106,19 +120,6 @@ module Puppet
end
end
- # If we're not root, we can check the values but we cannot change
- # them. We can't really do any processing here, because users
- # might not exist yet. FIXME There's still a bit of a problem here
- # if the user's UID changes at run time, but we're just going to
- # have to be okay with that for now, unfortunately.
- munge do |value|
- if tmp = self.validuser?(value)
- return tmp
- else
- return value
- end
- end
-
def sync
unless Puppet::SUIDManager.uid == 0
unless defined? @@notifieduid