Hello community, here is the log from the commit of package perl-Net-DNS for openSUSE:Factory checked in at 2020-02-19 12:39:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Net-DNS (Old) and /work/SRC/openSUSE:Factory/.perl-Net-DNS.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Net-DNS" Wed Feb 19 12:39:59 2020 rev:57 rq:774344 version:1.22 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Net-DNS/perl-Net-DNS.changes 2019-09-07 12:33:56.733669275 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Net-DNS.new.26092/perl-Net-DNS.changes 2020-02-19 12:40:01.303564697 +0100 @@ -1,0 +2,6 @@ +Fri Feb 14 03:11:08 UTC 2020 - <timueller+p...@suse.de> + +- updated to 1.22 + see /usr/share/doc/packages/perl-Net-DNS/Changes + +------------------------------------------------------------------- Old: ---- Net-DNS-1.21.tar.gz New: ---- Net-DNS-1.22.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Net-DNS.spec ++++++ --- /var/tmp/diff_new_pack.jGxbwu/_old 2020-02-19 12:40:02.387566785 +0100 +++ /var/tmp/diff_new_pack.jGxbwu/_new 2020-02-19 12:40:02.391566792 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Net-DNS # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: perl-Net-DNS -Version: 1.21 +Version: 1.22 Release: 0 %define cpan_name Net-DNS Summary: Perl Interface to the Domain Name System ++++++ Net-DNS-1.21.tar.gz -> Net-DNS-1.22.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/Changes new/Net-DNS-1.22/Changes --- old/Net-DNS-1.21/Changes 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/Changes 2020-02-13 11:42:25.000000000 +0100 @@ -1,4 +1,14 @@ -$Id: Changes 1757 2019-08-30 08:35:19Z willem $ -*-text-*- +$Id: Changes 1770 2020-02-13 10:42:04Z willem $ -*-text-*- + + +**** 1.22 Feb 13, 2020 + +Fix rt.cpan.org #131579 + + Parse issue in Net::DNS::RR->token + +Feature + Provide rudimentary decode and print for DSO packet. **** 1.21 Aug 30, 2019 @@ -30,7 +40,7 @@ Fix rt.cpan.org #128081 - Recurse.pm fails to resolve domain “kickboxingireland.ie” + Recurse.pm fails to resolve domain "kickboxingireland.ie" Fix rt.cpan.org #127307 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/META.json new/Net-DNS-1.22/META.json --- old/Net-DNS-1.21/META.json 2019-08-30 10:35:33.000000000 +0200 +++ new/Net-DNS-1.22/META.json 2020-02-13 11:42:30.000000000 +0100 @@ -55,6 +55,6 @@ } }, "release_status" : "stable", - "version" : "1.21", + "version" : "1.22", "x_serialization_backend" : "JSON::PP version 2.97001" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/META.yml new/Net-DNS-1.22/META.yml --- old/Net-DNS-1.21/META.yml 2019-08-30 10:35:33.000000000 +0200 +++ new/Net-DNS-1.22/META.yml 2020-02-13 11:42:30.000000000 +0100 @@ -36,5 +36,5 @@ Test::More: '0.52' Time::Local: '1.19' perl: '5.006' -version: '1.21' +version: '1.22' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/Makefile.PL new/Net-DNS-1.22/Makefile.PL --- old/Net-DNS-1.21/Makefile.PL 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/Makefile.PL 2020-02-13 11:42:25.000000000 +0100 @@ -1,5 +1,5 @@ # -# $Id: Makefile.PL 1726 2018-12-15 12:59:56Z willem $ -*-perl-*- +# $Id: Makefile.PL 1761 2020-01-01 11:58:34Z willem $ -*-perl-*- # use strict; @@ -52,23 +52,24 @@ my %optional = ( - 'Net::DNS::SEC' => 1.01, ## For information only 'Digest::BubbleBabble' => 0.01, 'Net::LibIDN2' => 1.00, ); +## IMPORTANT: THE USE AND/OR HANDLING OF STRONG ENCRYPTION TECHNOLOGIES IS +## PROHIBITED OR SEVERELY RESTRICTED IN MANY TERRITORIES. +delete $prerequisite{'Net::DNS::SEC'}; ## MUST NOT list Net::DNS::SEC dependency in metadata. +delete $optional{'Net::DNS::SEC'}; ## Require explicit user action to install Net::DNS::SEC. + + my @debris = qw( - .resolv.conf + .resolv.conf *.lock t/IPv6.enabled t/online.enabled t/online.nonfatal - zone[0-9].txt zone[0-9][0-9].txt ); -delete $optional{'Net::DNS::SEC'}; ## Note: MUST NOT be installed automatically - - use constant USE_SOCKET_IP => defined eval 'use IO::Socket::IP 0.32; 1'; use constant INET_FALLBACK => !USE_SOCKET_IP && eval 'require IO::Socket::INET'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/Nameserver.pm new/Net-DNS-1.22/lib/Net/DNS/Nameserver.pm --- old/Net-DNS-1.21/lib/Net/DNS/Nameserver.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/Nameserver.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,9 +1,9 @@ package Net::DNS::Nameserver; # -# $Id: Nameserver.pm 1692 2018-07-06 08:55:39Z willem $ +# $Id: Nameserver.pm 1761 2020-01-01 11:58:34Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1692 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1761 $)[1]; =head1 NAME @@ -82,6 +82,7 @@ # local server addresses must also be accepted by a resolver my $LocalAddr = $self{LocalAddr} || [DEFAULT_ADDR]; my $resolver = new Net::DNS::Resolver( nameservers => $LocalAddr ); + $resolver->force_v4(1) unless USE_SOCKET_IP; $resolver->force_v4(1) if FORCE_IPv4; my @localaddresses = $resolver->nameservers; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/Packet.pm new/Net-DNS-1.22/lib/Net/DNS/Packet.pm --- old/Net-DNS-1.21/lib/Net/DNS/Packet.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/Packet.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,9 +1,9 @@ package Net::DNS::Packet; # -# $Id: Packet.pm 1747 2019-06-27 15:02:31Z willem $ +# $Id: Packet.pm 1761 2020-01-01 11:58:34Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1747 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1761 $)[1]; =head1 NAME @@ -31,6 +31,7 @@ use integer; use Carp; +use Net::DNS::Parameters(qw(dsotypebyval)); use constant UDPSZ => 512; BEGIN { @@ -120,7 +121,7 @@ # header section my ( $id, $status, @count ) = unpack 'n6', $$data; my ( $qd, $an, $ns, $ar ) = @count; - $offset = HEADER_LENGTH; + my $length = length $$data; $self = bless { id => $id, @@ -130,12 +131,13 @@ answer => [], authority => [], additional => [], - replysize => length $$data + replysize => $length }, $class; # question/zone section my $hash = {}; my $record; + $offset = HEADER_LENGTH; while ( $qd-- ) { ( $record, $offset ) = decode Net::DNS::Question( $data, $offset, $hash ); CORE::push( @{$self->{question}}, $record ); @@ -157,7 +159,15 @@ CORE::push( @{$self->{additional}}, $record ); } - return $self; + return unless $offset == HEADER_LENGTH; + return unless $self->header->opcode eq 'DSO'; + + $self->{dso} = []; + while ( $offset < $length ) { + my ( $t, $l, $v ) = unpack "\@$offset n2a*", $$data; + CORE::push( @{$self->{dso}}, [$t, substr( $v, 0, $l )] ); + $offset += 4 + $l; + } }; if ($debug) { @@ -381,38 +391,42 @@ my $self = shift; my $header = $self->header; - my $update = $header->opcode eq 'UPDATE'; - my $server = $self->{replyfrom}; my $length = $self->{replysize}; - my $string = $server ? ";; Response received from $server ($length octets)\n" : ""; + my $origin = $server ? ";; Response received from $server ($length octets)\n" : ""; + my @record = ( "$origin;; HEADER SECTION", $header->string ); - $string .= ";; HEADER SECTION\n" . $header->string; + if ( $self->{dso} ) { + CORE::push( @record, ";; DSO SECTION" ); + foreach ( @{$self->{dso}} ) { + my ( $t, $v ) = @$_; + CORE::push( @record, pack 'a* A18 a*', ";;\t", dsotypebyval($t), unpack( 'H*', $v ) ); + } + return join "\n", @record, "\n"; + } - my $question = $update ? 'ZONE' : 'QUESTION'; - my @question = map $_->string, $self->question; + my @section = $header->opcode eq 'UPDATE' ? qw(ZONE PREREQUISITE UPDATE) : qw(QUESTION ANSWER AUTHORITY); + my @question = $self->question; my $qdcount = scalar @question; my $qds = $qdcount != 1 ? 's' : ''; - $string .= join "\n;; ", "\n;; $question SECTION ($qdcount record$qds)", @question; + CORE::push( @record, ";; $section[0] SECTION ($qdcount record$qds)", map ';; ' . $_->string, @question ); - my $answer = $update ? 'PREREQUISITE' : 'ANSWER'; - my @answer = map $_->string, $self->answer; + my @answer = $self->answer; my $ancount = scalar @answer; my $ans = $ancount != 1 ? 's' : ''; - $string .= join "\n", "\n\n;; $answer SECTION ($ancount record$ans)", @answer; + CORE::push( @record, "\n;; $section[1] SECTION ($ancount record$ans)", map $_->string, @answer ); - my $authority = $update ? 'UPDATE' : 'AUTHORITY'; - my @authority = map $_->string, $self->authority; + my @authority = $self->authority; my $nscount = scalar @authority; my $nss = $nscount != 1 ? 's' : ''; - $string .= join "\n", "\n\n;; $authority SECTION ($nscount record$nss)", @authority; + CORE::push( @record, "\n;; $section[2] SECTION ($nscount record$nss)", map $_->string, @authority ); - my @additional = map $_->string, $self->additional; + my @additional = $self->additional; my $arcount = scalar @additional; my $ars = $arcount != 1 ? 's' : ''; - $string .= join "\n", "\n\n;; ADDITIONAL SECTION ($arcount record$ars)", @additional; + CORE::push( @record, "\n;; ADDITIONAL SECTION ($arcount record$ars)", map $_->string, @additional ); - return "$string\n\n"; + join "\n", @record, "\n"; } @@ -839,7 +853,7 @@ Portions Copyright (c)2002-2009 Olaf Kolkman -Portions Copyright (c)2007-2015 Dick Franks +Portions Copyright (c)2007-2019 Dick Franks All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/Parameters.pm new/Net-DNS-1.22/lib/Net/DNS/Parameters.pm --- old/Net-DNS-1.21/lib/Net/DNS/Parameters.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/Parameters.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,15 +1,15 @@ package Net::DNS::Parameters; # -# $Id: Parameters.pm 1740 2019-04-04 14:45:31Z willem $ +# $Id: Parameters.pm 1761 2020-01-01 11:58:34Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1740 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1761 $)[1]; ################################################ ## ## Domain Name System (DNS) Parameters -## (last updated 2019-03-26) +## (last updated 2019-12-23) ## ################################################ @@ -126,12 +126,12 @@ MAILA => 254, # RFC1035 ANY => 255, # RFC1035 RFC6895 RFC8482 URI => 256, # RFC7553 - CAA => 257, # RFC6844 + CAA => 257, # RFC8659 AVC => 258, # DOA => 259, # draft-durand-doa-over-dns - AMTRELAY => 260, # draft-ietf-mboned-driad-amt-discovery + AMTRELAY => 260, # RFC-ietf-mboned-driad-amt-discovery-13 TA => 32768, # http://cameo.library.cmu.edu/ http://www.watson.org/~weiler/INI1999-19.pdf - DLV => 32769, # RFC4431 + DLV => 32769, # RFC-ietf-dnsop-obsolete-dlv-02 RFC4431 ); our %typebyval = reverse( TYPE0 => 0, @typebyname ); push @typebyname, map /^\d/ ? $_ : lc($_), @typebyname; @@ -184,7 +184,7 @@ # Registry: DNS EDNS0 Option Codes (OPT) my @ednsoptionbyname = ( - LLQ => 1, # http://files.dns-sd.org/draft-sekar-dns-llq.txt + LLQ => 1, # RFC-sekar-dns-llq-06 UL => 2, # http://files.dns-sd.org/draft-sekar-dns-ul.txt NSID => 3, # RFC5001 DAU => 5, # RFC6975 @@ -199,7 +199,6 @@ 'KEY-TAG' => 14, # RFC8145 'CLIENT-TAG' => 16, # draft-bellis-dnsop-edns-tags 'SERVER-TAG' => 17, # draft-bellis-dnsop-edns-tags - DEVICEID => 26946, # https://docs.umbrella.com/developer/networkdevices-api/identifying-dns-traffic2 ); our %ednsoptionbyval = reverse @ednsoptionbyname; @@ -233,6 +232,10 @@ KEEPALIVE => 0x0001, # RFC8490 RETRYDELAY => 0x0002, # RFC8490 ENCRYPTIONPADDING => 0x0003, # RFC8490 + SUBSCRIBE => 0x0040, # RFC-ietf-dnssd-push-25 + PUSH => 0x0041, # RFC-ietf-dnssd-push-25 + UNSUBSCRIBE => 0x0042, # RFC-ietf-dnssd-push-25 + RECONFIRM => 0x0043, # RFC-ietf-dnssd-push-25 ); our %dsotypebyval = reverse @dsotypebyname; push @dsotypebyname, map /^\d/ ? $_ : lc($_), @dsotypebyname; @@ -251,7 +254,7 @@ my $val = 0 + $2; croak qq[classbyname("$name") out of range] if $val > 0xffff; return $val; - } + } } sub classbyval { @@ -261,7 +264,7 @@ $val += 0; croak qq[classbyval($val) out of range] if $val > 0xffff; return "CLASS$val"; - } + } } @@ -276,7 +279,7 @@ } _typespec("$name.RRNAME") unless $typebyname{uc $name}; return $typebyname{uc $name} || croak qq[unknown type "$name"]; - } + } } sub typebyval { @@ -288,7 +291,7 @@ $typebyval{$val} = "TYPE$val"; _typespec("$val.RRTYPE"); return $typebyval{$val}; - } + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/RR/ZONEMD.pm new/Net-DNS-1.22/lib/Net/DNS/RR/ZONEMD.pm --- old/Net-DNS-1.21/lib/Net/DNS/RR/ZONEMD.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/RR/ZONEMD.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,9 +1,9 @@ package Net::DNS::RR::ZONEMD; # -# $Id: ZONEMD.pm 1740 2019-04-04 14:45:31Z willem $ +# $Id: ZONEMD.pm 1761 2020-01-01 11:58:34Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1740 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1761 $)[1]; use strict; @@ -27,14 +27,14 @@ my ( $data, $offset ) = @_; my $rdata = substr $$data, $offset, $self->{rdlength}; - @{$self}{qw(serial digtype reserved digestbin)} = unpack 'NC2a*', $rdata; + @{$self}{qw(serial digtype parameter digestbin)} = unpack 'NC2a*', $rdata; } sub _encode_rdata { ## encode rdata as wire-format octet string my $self = shift; - pack 'NC2a*', @{$self}{qw(serial digtype reserved digestbin)}; + pack 'NC2a*', @{$self}{qw(serial digtype parameter digestbin)}; } @@ -42,7 +42,7 @@ my $self = shift; my @digest = split /(\S{64})/, $self->digest || qq(""); - my @rdata = ( @{$self}{qw(serial digtype reserved)}, @digest ); + my @rdata = ( @{$self}{qw(serial digtype parameter)}, @digest ); } @@ -51,7 +51,7 @@ $self->serial(shift); $self->digtype(shift); - $self->reserved(shift); + $self->parameter(shift); $self->digest(@_); } @@ -59,7 +59,7 @@ sub _defaults { ## specify RR attribute default values my $self = shift; - @{$self}{qw(serial digtype reserved digestbin)} = ( 0, 1, 0, '' ); + $self->_parse_rdata( 0, 1, 0, '' ); } @@ -79,7 +79,12 @@ } -sub reserved {0} # uncoverable pod +sub parameter { + my $self = shift; + + $self->{parameter} = 0 + shift if scalar @_; + $self->{parameter} || 0; +} sub digest { @@ -136,6 +141,13 @@ 8-bit integer digest type field. +=head2 parameter + + $parameter = $rr->parameter; + $rr->parameter( $parameter ); + +Digest algorithm parameter field. + =head2 digest $digest = $rr->digest; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/RR.pm new/Net-DNS-1.22/lib/Net/DNS/RR.pm --- old/Net-DNS-1.21/lib/Net/DNS/RR.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/RR.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,9 +1,9 @@ package Net::DNS::RR; # -# $Id: RR.pm 1748 2019-07-15 07:57:00Z willem $ +# $Id: RR.pm 1762 2020-02-02 21:39:02Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1748 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1762 $)[1]; =head1 NAME @@ -340,7 +340,7 @@ my $last = pop(@line); # last or only line $last = join $tab, @core, "@rdata" unless scalar(@line); - return join "\n\t", @line, _wrap( $last, map "; $_", $self->_annotation ); + join "\n\t", @line, _wrap( $last, map "; $_", $self->_annotation ); } @@ -355,7 +355,10 @@ =cut sub plain { - join ' ', shift->token; + my $string = join ' ', shift->token; + $string =~ s/\\034/\\"/g; # unescape " + $string =~ s/\\092/\\\\/g; # unescape escape + return $string; } @@ -376,7 +379,7 @@ my @rdata = $self->_empty ? () : eval { $self->_format_rdata }; # parse into quoted strings, contiguous non-whitespace and (discarded) comments - my @parse = map { s/\\\\/\\092/g; s/\\"/\\034/g; split /$PARSE_REGEX/o; } @rdata; + my @parse = map split( /$PARSE_REGEX/o, $_ ), @rdata; my @token = ( @core, grep defined && length, @parse ); } @@ -732,6 +735,8 @@ my ( @line, @fill ); foreach (@text) { + s/\\034/\\"/g; # unescape " + s/\\092/\\\\/g; # unescape escape if ( ( $coln += 1 + length ) > $cols ) { # start new line push @line, join ' ', @fill if scalar @fill; $coln = length; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/Resolver/Base.pm new/Net-DNS-1.22/lib/Net/DNS/Resolver/Base.pm --- old/Net-DNS-1.21/lib/Net/DNS/Resolver/Base.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/Resolver/Base.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,9 +1,9 @@ package Net::DNS::Resolver::Base; # -# $Id: Base.pm 1748 2019-07-15 07:57:00Z willem $ +# $Id: Base.pm 1762 2020-02-02 21:39:02Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1748 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1762 $)[1]; # @@ -636,14 +636,14 @@ sub bgisready { ## historical - _deprecate('prefer bgbusy()'); # uncoverable pod + _deprecate('prefer ! bgbusy(...)'); # uncoverable pod !&bgbusy; } sub bgread { while (&bgbusy) { # side effect: TCP retry - IO::Select->new( $_[1] )->can_read(0.02); # use 3 orders of magnitude less CPU + IO::Select->new( $_[1] )->can_read(0.02); # reduce my CPU usage by 3 orders of magnitude } &_bgread; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/Text.pm new/Net-DNS-1.22/lib/Net/DNS/Text.pm --- old/Net-DNS-1.21/lib/Net/DNS/Text.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/Text.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,9 +1,9 @@ package Net::DNS::Text; # -# $Id: Text.pm 1748 2019-07-15 07:57:00Z willem $ +# $Id: Text.pm 1762 2020-02-02 21:39:02Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1748 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1762 $)[1]; =head1 NAME @@ -188,12 +188,8 @@ my $self = shift; my @s = map split( '', $_ ), @$self; # escape special and ASCII non-printable - my $string = _decode_utf8( join '', map $escape{$_}, @s ); - - return $string unless $string =~ /[ \t\n\r\f"]|^$/; # unquoted contiguous - - $string =~ s/\\([^"0-9])/$1/g; # unescape printable characters except \" - join '', '"', $string, '"'; # quoted string + my $s = _decode_utf8( join '', map $escape{$_}, @s ); + return $s =~ /\\034|[ \t\n\r\f();]|^$/ ? qq("$s") : $s; # quote special characters and empty string } @@ -234,12 +230,9 @@ my @C0 = ( 0 .. 31 ); # control characters my @NA = UTF8 ? ( 192, 193, 216 .. 223, 245 .. 255 ) : ( 128 .. 255 ); - my %table = ( # transparent, \" \( \) \; \\ - map( ( $_ => $_ ), map pack( 'C', $_ ), ( 0 .. 255 ) ), - map( ( pack( 'C', $_ ) => pack( 'C2', 92, $_ ) ), ( 34, 40, 41, 59, 92 ) ), - ); + my %table = map( ( $_ => $_ ), map pack( 'C', $_ ), ( 0 .. 255 ) ); - foreach my $n ( @C0, 92, 127, @NA ) { # numerical escape + foreach my $n ( @C0, 34, 92, 127, @NA ) { # numerical escape my $codepoint = sprintf( '%03u', $n ); # transliteration for non-ASCII character encodings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS/ZoneFile.pm new/Net-DNS-1.22/lib/Net/DNS/ZoneFile.pm --- old/Net-DNS-1.21/lib/Net/DNS/ZoneFile.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS/ZoneFile.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,9 +1,9 @@ package Net::DNS::ZoneFile; # -# $Id: ZoneFile.pm 1748 2019-07-15 07:57:00Z willem $ +# $Id: ZoneFile.pm 1769 2020-02-13 10:40:40Z willem $ # -our $VERSION = (qw$LastChangedRevision: 1748 $)[1]; +our $VERSION = (qw$LastChangedRevision: 1769 $)[1]; =head1 NAME @@ -94,9 +94,10 @@ croak 'argument not a file handle'; } - $self->{filename} = $file ||= ''; - $self->{filehandle} = new IO::File($file) or croak "$! $file"; + croak 'filename argument undefined' unless $file; + $self->{filehandle} = new IO::File( $file, '<' ) or croak "$file: $!"; $self->{fileopen}{$file}++; + $self->{filename} = $file; return $self; } @@ -533,8 +534,8 @@ my $opened = {%{$self->{fileopen}}}; die qq(\$INCLUDE $file: Unexpected recursion) if $opened->{$file}++; - my @discipline = PERLIO ? ( join ':', '<', PerlIO::get_layers $self->{filehandle} ) : (); - my $filehandle = new IO::File( $file, @discipline ) or die qq(\$INCLUDE $file: $!); + my $discipline = PERLIO ? join( ':', '<', PerlIO::get_layers $self->{filehandle} ) : '<'; + my $filehandle = new IO::File( $file, $discipline ) or die qq(\$INCLUDE $file: $!); delete $self->{latest}; # forget previous owner $self->{parent} = bless {%$self}, ref($self); # save state, create link diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/lib/Net/DNS.pm new/Net-DNS-1.22/lib/Net/DNS.pm --- old/Net-DNS-1.21/lib/Net/DNS.pm 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/lib/Net/DNS.pm 2020-02-13 11:42:25.000000000 +0100 @@ -1,13 +1,13 @@ package Net::DNS; # -# $Id: DNS.pm 1757 2019-08-30 08:35:19Z willem $ +# $Id: DNS.pm 1770 2020-02-13 10:42:04Z willem $ # require 5.006; our $VERSION; -$VERSION = '1.21'; +$VERSION = '1.22'; $VERSION = eval $VERSION; -our $SVNVERSION = (qw$LastChangedRevision: 1757 $)[1]; +our $SVNVERSION = (qw$LastChangedRevision: 1770 $)[1]; =head1 NAME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/t/02-text.t new/Net-DNS-1.22/t/02-text.t --- old/Net-DNS-1.21/t/02-text.t 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/t/02-text.t 2020-02-13 11:42:25.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: 02-text.t 1749 2019-07-21 09:15:55Z willem $ -*-perl-*- +# $Id: 02-text.t 1762 2020-02-02 21:39:02Z willem $ -*-perl-*- use strict; use Test::More tests => 37; @@ -133,8 +133,8 @@ { my %testcase = ( - '202122232425262728292a2b2c2d2e2f' => q|" !\"#$%&'()*+,-./"|, - '303132333435363738393a3b3c3d3e3f' => '0123456789:\;<=>?', + '202122232425262728292a2b2c2d2e2f' => q|" !\034#$%&'()*+,-./"|, + '303132333435363738393a3b3c3d3e3f' => q|"0123456789:;<=>?"|, '404142434445464748494a4b4c4d4e4f' => '@ABCDEFGHIJKLMNO', '505152535455565758595a5b5c5d5e5f' => 'PQRSTUVWXYZ[\092]^_', '606162636465666768696a6b6c6d6e6f' => '`abcdefghijklmno', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/t/04-packet.t new/Net-DNS-1.22/t/04-packet.t --- old/Net-DNS-1.21/t/04-packet.t 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/t/04-packet.t 2020-02-13 11:42:25.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: 04-packet.t 1749 2019-07-21 09:15:55Z willem $ -*-perl-*- +# $Id: 04-packet.t 1761 2020-01-01 11:58:34Z willem $ -*-perl-*- use strict; @@ -126,7 +126,7 @@ foreach my $section (qw(answer authority additional)) { my @original = map { $_->ttl(0); $_->string } $update->$section; # almost! need TTL defined - my @content = map { $_->string } $decoded->$section; + my @content = map { $_->string } $decoded->$section; is_deeply( \@content, \@original, "check content of $section section" ); } @@ -212,21 +212,20 @@ } -eval { ## exercise but do not test print +eval { ## exercise dump and debug diagnostics require Data::Dumper; local $Data::Dumper::Maxdepth; local $Data::Dumper::Sortkeys; - my $object = new Net::DNS::Packet('example.com'); - my $buffer = $object->data; + my $packet = new Net::DNS::Packet(); + $packet->header->opcode('DSO'); + my $buffer = $packet->data . pack( 'n2H*', 1, 3, 'c0ffee' ); my $corrupt = substr $buffer, 0, 10; my $filename = '04-packet.txt'; open( TEMP, ">$filename" ) || die "Could not open $filename for writing"; - select( ( select(TEMP), $object->print )[0] ); - select( ( select(TEMP), $object->dump )[0] ); + select( ( select(TEMP), $packet->dump )[0] ); $Data::Dumper::Maxdepth = 6; $Data::Dumper::Sortkeys = 1; - select( ( select(TEMP), $object->dump )[0] ); - select( ( select(TEMP), Net::DNS::Packet->new( \$buffer, 1 ) )[0] ); + select( ( select(TEMP), Net::DNS::Packet->new( \$buffer, 1 )->dump )[0] ); select( ( select(TEMP), Net::DNS::Packet->new( \$corrupt, 1 ) )[0] ); close(TEMP); unlink($filename); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/t/05-ZONEMD.t new/Net-DNS-1.22/t/05-ZONEMD.t --- old/Net-DNS-1.21/t/05-ZONEMD.t 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/t/05-ZONEMD.t 2020-02-13 11:42:25.000000000 +0100 @@ -1,18 +1,18 @@ -# $Id: 05-ZONEMD.t 1740 2019-04-04 14:45:31Z willem $ -*-perl-*- +# $Id: 05-ZONEMD.t 1761 2020-01-01 11:58:34Z willem $ -*-perl-*- use strict; -use Test::More tests => 19; +use Test::More tests => 20; use Net::DNS; my $name = 'ZONEMD.example'; my $type = 'ZONEMD'; my $code = 63; -my @attr = qw( serial digtype reserved digest); -my @data = ( 12345, 1, 0, '2bb183af5f22588179a53b0a98631fad1a292118' ); +my @attr = qw( serial digtype parameter digest); +my @data = ( 12345, 1, 2, '2bb183af5f22588179a53b0a98631fad1a292118' ); my @also = qw( digestbin ); -my $wire = join '', qw( 00003039 01 00 2BB183AF5F22588179A53B0A98631FAD1A292118 ); +my $wire = join '', qw( 00003039 01 02 2BB183AF5F22588179A53B0A98631FAD1A292118 ); { @@ -56,14 +56,14 @@ { my $rr = new Net::DNS::RR(". $type"); - foreach ( @attr, 'rdstring' ) { + foreach ( @attr, @also, 'rdstring' ) { ok( !$rr->$_(), "'$_' attribute of empty RR undefined" ); } } { - my $rr = new Net::DNS::RR( type => $type, serial => 12345 ); + my $rr = new Net::DNS::RR( type => $type, digtype => 1 ); ok( $rr->string, 'string method with default values' ); is( $rr->string, Net::DNS::RR->new( $rr->string )->string, 'parse $rr->string' ); $rr->digestbin(''); @@ -72,7 +72,7 @@ { - my $rr = new Net::DNS::RR(". $type @data"); + my $rr = new Net::DNS::RR( type => $type ); eval { $rr->digest('123456789XBCDEF'); }; my ($exception) = split /\n/, "$@\n"; ok( $exception, "corrupt hexadecimal\t[$exception]" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/t/08-IPv4.t new/Net-DNS-1.22/t/08-IPv4.t --- old/Net-DNS-1.21/t/08-IPv4.t 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/t/08-IPv4.t 2020-02-13 11:42:25.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: 08-IPv4.t 1740 2019-04-04 14:45:31Z willem $ -*-perl-*- +# $Id: 08-IPv4.t 1761 2020-01-01 11:58:34Z willem $ -*-perl-*- use strict; use Test::More; @@ -431,7 +431,7 @@ ok( !$resolver->bgread(undef), '_bgread() undefined handle' ); my $packet = $resolver->_make_query_packet(qw(net-dns.org SOA)); - my $second = $resolver->_make_query_packet(qw(net-dns.org SOA)); + my $second = bless {%$packet, id => -1}, ref($packet); my $handle = $resolver->_bgsend_udp( $packet, $second->data ); ok( !$resolver->bgread($handle), '_bgread() no reply' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Net-DNS-1.21/t/08-IPv6.t new/Net-DNS-1.22/t/08-IPv6.t --- old/Net-DNS-1.21/t/08-IPv6.t 2019-08-30 10:35:26.000000000 +0200 +++ new/Net-DNS-1.22/t/08-IPv6.t 2020-02-13 11:42:25.000000000 +0100 @@ -1,4 +1,4 @@ -# $Id: 08-IPv6.t 1741 2019-04-16 13:10:38Z willem $ -*-perl-*- +# $Id: 08-IPv6.t 1761 2020-01-01 11:58:34Z willem $ -*-perl-*- use strict; use Test::More; @@ -434,7 +434,7 @@ ok( !$resolver->bgread(undef), '_bgread() undefined handle' ); my $packet = $resolver->_make_query_packet(qw(net-dns.org SOA)); - my $second = $resolver->_make_query_packet(qw(net-dns.org SOA)); + my $second = bless {%$packet, id => -1}, ref($packet); my $handle = $resolver->_bgsend_udp( $packet, $second->data ); ok( !$resolver->bgread($handle), '_bgread() no reply' );