Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 61725
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: OLAF [...] cpan.org
Requestors: mrallen1 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.66
Fixed in: (no value)



Subject: Net::DNS::Resolver::Win32 parses the searchlist incorrectly if there is a domain value
Because there is no comma seperating the $domain value from the rest of the search list. Also not all duplicates are removed from the searchlist because of case- matching (i.e., Example.com != example.com in regex) but DNS doesn't care about case. So lowercase the searchlist just to be defensive. The attached patch fixes these issues and some minor whitespace issues.
Subject: win32.pm.diff
--- Win32-orig.pm Tue Sep 28 10:53:14 2010 +++ Win32.pm Tue Sep 28 11:09:20 2010 @@ -16,7 +16,7 @@ use Data::Dumper; sub init { - my $debug=0; + my $debug=0; my ($class) = @_; my $defaults = $class->defaults; @@ -52,7 +52,7 @@ } my $domain=$FIXED_INFO->{'DomainName'}||''; - my $searchlist = "$domain" ; + my $searchlist; # @@ -70,23 +70,25 @@ or $opened_registry =0; } + if ($domain) { + $defaults->{'domain'} = $domain; + $searchlist = $domain; + } if ($opened_registry && $resobj->GetValues(\%keys)){ + $searchlist .= "," if $searchlist; # $domain already in there $searchlist .= $keys{'SearchList'}->[2]; } - if ($domain) { - $defaults->{'domain'} = $domain; - } my $usedevolution = $keys{'UseDomainNameDevolution'}->[2]; if ($searchlist) { # fix devolution if configured, and simultaneously make sure no dups (but keep the order) my @a; my %h; - foreach my $entry (split(m/[\s,]+/, $searchlist)) { + foreach my $entry (split(m/[\s,]+/, lc $searchlist)) { push(@a, $entry) unless $h{$entry}; $h{$entry} = 1; if ($usedevolution) {
Thanks... quickly skimming this it all looks sane. I will look at it more closely later when I find some time to dive into some Net::DNS maintenance. (think month rather than weeks) Thanks ! --Olaf
Hi Mark, I have your patch applied. It will be in the new release which will follow shortly. Thanks! -- Willem