summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2009-12-13 22:44:07 -0800
committerJames Turnbull <james@lovedthanlost.net>2009-12-18 14:10:38 +1100
commit857047d956aa0e78e105df2330346dbd6fcd8c35 (patch)
tree5c68483bab0065e9cb63c8b218f56f1495dcadc6 /lib
parentdddbd2821b6602a8d358de1313553dc25b37a998 (diff)
downloadpuppet-857047d956aa0e78e105df2330346dbd6fcd8c35.tar.gz
puppet-857047d956aa0e78e105df2330346dbd6fcd8c35.tar.xz
puppet-857047d956aa0e78e105df2330346dbd6fcd8c35.zip
Fix for #2567 (Authstore does unintended/pointless DNS lookups)
This patch fixes #2567 by always pre-validating IP addresses with a strict regular expression check before calling IPAddr.new() on them.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/network/authstore.rb5
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/puppet/network/authstore.rb b/lib/puppet/network/authstore.rb
index 42c34ab86..b4bf320b3 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)]