net.dns: Stricter matching of nameserver entries in resolv.conf

Thu, 24 Sep 2009 23:25:18 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 24 Sep 2009 23:25:18 +0100
changeset 1820
3e0e9f80010a
parent 1814
e2f0c514d039
child 1821
05ed826da89b

net.dns: Stricter matching of nameserver entries in resolv.conf

net/dns.lua file | annotate | diff | comparison | revisions
--- a/net/dns.lua	Thu Sep 24 11:14:05 2009 +0100
+++ b/net/dns.lua	Thu Sep 24 23:25:18 2009 +0100
@@ -507,7 +507,7 @@
   local resolv_conf = io.open("/etc/resolv.conf");
   if resolv_conf then
 	  for line in resolv_conf:lines() do
-		local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)')
+		local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)%s*$')
 		if address then self:addnameserver (address)  end
 	  end
   elseif os.getenv("WINDIR") then

mercurial