summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-17 15:06:48 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-17 15:06:48 +0000
commit6654c4cb44a0043314b2cb5cbefe3f6c1529aa23 (patch)
tree253b5bc18755bf23616fb875c1407d36e15be634 /lib
parent106d397bc0de9512b24724c5b3ed95db501671ea (diff)
downloadpuppet-6654c4cb44a0043314b2cb5cbefe3f6c1529aa23.tar.gz
puppet-6654c4cb44a0043314b2cb5cbefe3f6c1529aa23.tar.xz
puppet-6654c4cb44a0043314b2cb5cbefe3f6c1529aa23.zip
fixing users on normal machines
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@685 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/type/user.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index 43374d1f4..c0e82a2e3 100755
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -65,12 +65,24 @@ module Puppet
def should=(gid)
method = :getgrgid
- if gid.is_a?(String)
+ case gid
+ when String
if gid =~ /^[-0-9]+$/
gid = Integer(gid)
else
method = :getgrnam
end
+ when Integer
+ unless gid >= 0
+ raise Puppet::Error, "GIDs must be positive"
+ end
+ when Symbol
+ unless gid == :auto or gid == :notfound
+ raise Puppet::DevError, "Invalid GID %s" % gid
+ end
+ # these are treated specially by sync()
+ @should = gid
+ return
end
# FIXME this should really check to see if we already have a