summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-24 12:17:52 -0600
committerLuke Kanies <luke@madstop.com>2008-11-24 12:17:52 -0600
commitb415848841edac9b08ff604416ad2e24dd350b4d (patch)
tree85d4a612720cbacc2efd4aad1db27afea22b4efe /lib/puppet
parent9ed382d397c79995e850a91ac92e22106d670bed (diff)
downloadpuppet-b415848841edac9b08ff604416ad2e24dd350b4d.tar.gz
puppet-b415848841edac9b08ff604416ad2e24dd350b4d.tar.xz
puppet-b415848841edac9b08ff604416ad2e24dd350b4d.zip
Fixing #1708 - user groups specified as names are now detected correctly.
There was a bug when groups were specified by name -- the group was always compared to the current gid, rather than being converted to an integer and comparing that way. This is now fixed. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/type/user.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index 637fe9b46..0fe7928e6 100755
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -98,6 +98,16 @@ module Puppet
end
end
+ def insync?(is)
+ # We know the 'is' is a number, so we need to convert the 'should' to a number,
+ # too.
+ @should.each do |value|
+ return true if number = Puppet::Util.gid(value) and is == number
+ end
+
+ return false
+ end
+
def sync
found = false
@should.each do |value|