Ticket #1169: 0001-Extend-workaround-from-56aad69f8cdf8b0b08fdb79850149.patch
| File 0001-Extend-workaround-from-56aad69f8cdf8b0b08fdb79850149.patch, 2.7 kB (added by arogge, 8 months ago) |
|---|
-
a/lib/puppet/type/file/group.rb
old new 11 11 end 12 12 13 13 def id2name(id) 14 if id > 70000 15 return nil 16 end 17 if id.is_a?(Symbol) 18 return id.to_s 19 end 14 return id.to_s if id.is_a?(Symbol) 15 return nil if id > Puppet[:maximum_uid].to_i 20 16 begin 21 17 group = Etc.getgrgid(id) 22 18 rescue ArgumentError … … 73 69 @method = :chown 74 70 end 75 71 76 return stat.gid 72 currentvalue = stat.gid 73 74 # On OS X, files that are owned by -2 get returned as really 75 # large GIDs instead of negative ones. This isn't a Ruby bug, 76 # it's an OS X bug, since it shows up in perl, too. 77 if currentvalue > Puppet[:maximum_uid].to_i 78 self.warning "Apparently using negative GID (%s) on a platform that does not consistently handle them" % currentvalue 79 currentvalue = :silly 80 end 81 82 return currentvalue 77 83 end 78 84 79 85 # Determine if the group is valid, and if so, return the GID -
a/lib/puppet/util/posix.rb
old new 13 13 end 14 14 prefix = "get" + space.to_s 15 15 if id.is_a?(Integer) 16 if id > 100000016 if id > Puppet[:maximum_uid].to_i 17 17 Puppet.err "Tried to get %s field for silly id %s" % [field, id] 18 18 return nil 19 19 end … … 40 40 end 41 41 if id.is_a?(Integer) 42 42 integer = true 43 if id > 100000043 if id > Puppet[:maximum_uid].to_i 44 44 Puppet.err "Tried to get %s field for silly id %s" % [field, id] 45 45 return nil 46 46 end