Issue #11499 has been updated by Daniel Pittman.

Status changed from Accepted to In Topic Branch Pending Review
Branch set to https://github.com/puppetlabs/puppet/pull/296

https://github.com/puppetlabs/puppet/pull/296

(#11499) Better validation for IPv4 and IPv6 address in host type.

The previous code was fairly lax in validation, and would allow a bunch of
invalid addresses through - as well as rejecting some legal, but uncommon,
IPv6 address types.

This adds substantial testing, especially around IPv6 addressing, and replaces
the older validation with new, fancy stuff that works for all the cases.

----------------------------------------
Bug #11499: validation code for puppet resource host does not properly check if 
ip is valid
https://projects.puppetlabs.com/issues/11499

Author: Garrett Honeycutt
Status: In Topic Branch Pending Review
Priority: Normal
Assignee: Daniel Pittman
Category: host
Target version: 
Affected Puppet version: 2.7.6
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/296


It appears that we only check that the digits are [0-9] and period, while we 
should be doing an actual IP check

Attempting to use a letter. Fails as expected.
<pre>
[root@puppet ~]# puppet resource host junk.tld ip=1.2.3.a ensure=present
Could not run: Parameter ip failed: Invalid IP address
</pre>

Attempting to use a bad IP, which works and should not.
<pre>
[root@puppet ~]# puppet resource host junk.tld ip=10.10.10.10.10 ensure=present
notice: /Host[junk.tld]/ensure: created
host { 'junk.tld':
  ensure => 'present',
  ip     => '10.10.10.10.10',
  target => '/etc/hosts',
}
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to