Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: ZDM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Net::DNS::Resolver::MSWin32 critical issue
require Net::DNS::Resolver::MSWin32; Bareword "KEY_READ" not allowed while "strict subs" in use at d:/devel/perl/perl/site/lib/Net/DNS/Resolver/MSWin32.pm line 66. Please, fix imports.
From: rwfranks [...] acm.org
On Fri Mar 24 21:57:06 2017, ZDM wrote: Show quoted text
> require Net::DNS::Resolver::MSWin32; > Bareword "KEY_READ" not allowed while "strict subs" in use at > d:/devel/perl/perl/site/lib/Net/DNS/Resolver/MSWin32.pm line 66. > > Please, fix imports.
OS version ? Compiler ? Perl version ? Net::DNS version ? Win32::TieRegistry version ? All relevant, none specified
Subject: Re: [rt.cpan.org #120748] Net::DNS::Resolver::MSWin32 critical issue
Date: Sat, 25 Mar 2017 12:03:34 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
OS - windows 10 x64; compiler - mingw gcc 4.9.2; perl - strawberry perl 5.24.1 x64; Net::DNS - 1.09; TieRegistry - latest; you just need to use full constant name $Win32::TieRegistry:: in lines 66, 70 and 78 of MSWin32.pm, this works. Or clarify, why TieRegistry constants wasn't imported. On 25.03.2017 11:57, Dick Franks via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120748 > > > On Fri Mar 24 21:57:06 2017, ZDM wrote:
>> require Net::DNS::Resolver::MSWin32; >> Bareword "KEY_READ" not allowed while "strict subs" in use at >> d:/devel/perl/perl/site/lib/Net/DNS/Resolver/MSWin32.pm line 66. >> >> Please, fix imports.
> > OS version ? > Compiler ? > Perl version ? > Net::DNS version ? > Win32::TieRegistry version ? > > All relevant, none specified >
From: rwfranks [...] acm.org
On Sat Mar 25 06:04:03 2017, dzagashev@gmail.com wrote: Show quoted text
> OS - windows 10 x64; > compiler - mingw gcc 4.9.2; > perl - strawberry perl 5.24.1 x64; > Net::DNS - 1.09; > TieRegistry - latest; > > you just need to use full constant name $Win32::TieRegistry:: in lines > 66, 70 and 78 of MSWin32.pm, this works. Or clarify, why TieRegistry > constants wasn't imported.
Are you telling me that the import at line 28 no longer works? Even if we steer round the problem in the way you suggest, I would like to know why we are doing so. Thanks for rapid response.
Subject: Re: [rt.cpan.org #120748] Net::DNS::Resolver::MSWin32 critical issue
Date: Sat, 25 Mar 2017 12:45:55 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
Error message says, that imported constant is not available. So, problem in import. On 25.03.2017 12:26, Dick Franks via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120748 > > > On Sat Mar 25 06:04:03 2017, dzagashev@gmail.com wrote:
>> OS - windows 10 x64; >> compiler - mingw gcc 4.9.2; >> perl - strawberry perl 5.24.1 x64; >> Net::DNS - 1.09; >> TieRegistry - latest; >> >> you just need to use full constant name $Win32::TieRegistry:: in lines >> 66, 70 and 78 of MSWin32.pm, this works. Or clarify, why TieRegistry >> constants wasn't imported.
> > Are you telling me that the import at line 28 no longer works? > > Even if we steer round the problem in the way you suggest, I would like to know why we are doing so. > > Thanks for rapid response. >
Subject: Re: [rt.cpan.org #120748] Net::DNS::Resolver::MSWin32 critical issue
Date: Sat, 25 Mar 2017 12:48:29 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
the problem is, that you call import method manually, this happens on execution phase, but in compilation phase this constant is not available. You should put require and import call in BEGIN block or use full constants names. On 25.03.2017 12:26, Dick Franks via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120748 > > > On Sat Mar 25 06:04:03 2017, dzagashev@gmail.com wrote:
>> OS - windows 10 x64; >> compiler - mingw gcc 4.9.2; >> perl - strawberry perl 5.24.1 x64; >> Net::DNS - 1.09; >> TieRegistry - latest; >> >> you just need to use full constant name $Win32::TieRegistry:: in lines >> 66, 70 and 78 of MSWin32.pm, this works. Or clarify, why TieRegistry >> constants wasn't imported.
> > Are you telling me that the import at line 28 no longer works? > > Even if we steer round the problem in the way you suggest, I would like to know why we are doing so. > > Thanks for rapid response. >
Subject: Re: [rt.cpan.org #120748] Net::DNS::Resolver::MSWin32 critical issue
Date: Sat, 25 Mar 2017 12:51:00 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
or write KEY_READ() instead of bareword KEY_READ. compiler can;t understand, what you mean ;-) On 25.03.2017 12:26, Dick Franks via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120748 > > > On Sat Mar 25 06:04:03 2017, dzagashev@gmail.com wrote:
>> OS - windows 10 x64; >> compiler - mingw gcc 4.9.2; >> perl - strawberry perl 5.24.1 x64; >> Net::DNS - 1.09; >> TieRegistry - latest; >> >> you just need to use full constant name $Win32::TieRegistry:: in lines >> 66, 70 and 78 of MSWin32.pm, this works. Or clarify, why TieRegistry >> constants wasn't imported.
> > Are you telling me that the import at line 28 no longer works? > > Even if we steer round the problem in the way you suggest, I would like to know why we are doing so. > > Thanks for rapid response. >
Subject: Re: [rt.cpan.org #120748] Net::DNS::Resolver::MSWin32 critical issue
Date: Sat, 25 Mar 2017 12:58:33 +0200
To: bug-Net-DNS [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
better will be to not call import, but use full names Win32::TieRegistry::KEY_READ(). this will be faster. On 25.03.2017 12:51, dzagashev@gmail.com via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120748 > > > or write KEY_READ() instead of bareword KEY_READ. > compiler can;t understand, what you mean ;-) > > On 25.03.2017 12:26, Dick Franks via RT wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=120748 > >> >> On Sat Mar 25 06:04:03 2017, dzagashev@gmail.com wrote:
>>> OS - windows 10 x64; >>> compiler - mingw gcc 4.9.2; >>> perl - strawberry perl 5.24.1 x64; >>> Net::DNS - 1.09; >>> TieRegistry - latest; >>> >>> you just need to use full constant name $Win32::TieRegistry:: in lines >>> 66, 70 and 78 of MSWin32.pm, this works. Or clarify, why TieRegistry >>> constants wasn't imported.
>> >> Are you telling me that the import at line 28 no longer works? >> >> Even if we steer round the problem in the way you suggest, I would like to know why we are doing so. >> >> Thanks for rapid response. >>
From: rwfranks [...] acm.org
I will send you a modified version for you to test.
From: rwfranks [...] acm.org
On Fri Mar 24 21:57:06 2017, ZDM wrote: Show quoted text
> require Net::DNS::Resolver::MSWin32; > Bareword "KEY_READ" not allowed while "strict subs" in use at > d:/devel/perl/perl/site/lib/Net/DNS/Resolver/MSWin32.pm line 66. > > Please, fix imports.
The compiler elects to treat the bare word as a quoted string. Tie::Registry, for reasons of its own, accepts {Access => 'KEY_READ'} as an alternative to the value of the imported constant. Although obviously wrong, the failed import therefore has no material effect beyond creating unwelcome compiler noise. Testing and subsequent analysis exposed four further bugs: 1) The local domain name is retrieved but never appears in the searchlist. 2) Search list entries differing only by the trailing '.' are not recognised as duplicates. 3) The same code fragment appears in cygwin.pm and in that context, searchlist entries differing only by upper/lower case are not recognised as duplicates. 4) A search list entry with a trailing '.' causes the "devolution" loop to add an unadorned TLD label to the searchlist.
From: rwfranks [...] acm.org
On Mon Mar 27 09:39:29 2017, rwfranks@acm.org wrote: Show quoted text
> On Fri Mar 24 21:57:06 2017, ZDM wrote:
> > require Net::DNS::Resolver::MSWin32; > > Bareword "KEY_READ" not allowed while "strict subs" in use at > > d:/devel/perl/perl/site/lib/Net/DNS/Resolver/MSWin32.pm line 66. > > > > Please, fix imports.
> > The compiler elects to treat the bare word as a quoted string. > Tie::Registry, for reasons of its own, accepts {Access => 'KEY_READ'} > as an alternative to the value of the imported constant. Although > obviously wrong, the failed import therefore has no material effect > beyond creating unwelcome compiler noise.
I take that back. That only happens if no strict.
From: rwfranks [...] acm.org
Fixed in Net::DNS 1.10