# File lib/puppet/util/posix.rb, line 33
33:     def search_posix_field(type, field, id)
34:         idmethod = idfield(type)
35:         integer = false
36:         if id.is_a?(Integer)
37:             integer = true
38:             if id > Puppet[:maximum_uid].to_i
39:                 Puppet.err "Tried to get %s field for silly id %s" % [field, id]
40:                 return nil
41:             end
42:         end
43: 
44:         Etc.send(type) do |object|
45:             if integer and object.send(idmethod) == id
46:                 return object.send(field)
47:             elsif object.name == id
48:                 return object.send(field)
49:             end
50:         end
51: 
52:         # Apparently the group/passwd methods need to get reset; if we skip
53:         # this call, then new users aren't found.
54:         case type
55:         when :passwd; Etc.send(:endpwent)
56:         when :group; Etc.send(:endgrent)
57:         end
58:         return nil
59:     end