This patch fixes #2567 by always pre-validating IP addresses with a
strict regular expression check before calling IPAddr.new() on them.

Signed-off-by: Markus Roberts <[email protected]>
---
 lib/puppet/network/authstore.rb |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/lib/puppet/network/authstore.rb b/lib/puppet/network/authstore.rb
index 42c34ab..b4bf320 100755
--- a/lib/puppet/network/authstore.rb
+++ b/lib/puppet/network/authstore.rb
@@ -221,11 +221,6 @@ module Puppet
             Octet = '(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])'
             IPv4 = "#{Octet}\.#{Octet}\.#{Octet}\.#{Octet}" 
             def parse(value)
-                begin
-                    ipa = IPAddr.new(value)
-                rescue
-                    # Well, looks like that was a mistake
-                end
                 @name,@exact,@length,@pattern = *case value
                 when /^#{IPv4}\/(\d+)$/                                   # 
12.34.56.78/24
                     [:ip,:inexact,$1.to_i,IPAddr.new(value)]
-- 
1.6.4

--

You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en.


Reply via email to