Skip to content

Commit 03ba7cd

Browse files
authored
Merge pull request #1462 from zonemaster/develop
Merge develop branch into master (Engine)
2 parents 1296c72 + f41b340 commit 03ba7cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4112
-2729
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# While technically text, diffs are meaningless on test data files.
2+
t/*.data -diff

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- develop
2121
#- latest
2222
perl:
23-
- '5.38'
24-
- '5.34'
23+
- '5.40'
24+
- '5.36'
2525
- '5.26'
2626
runner:
2727
- ubuntu-22.04

Changes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
Release history for Zonemaster component Zonemaster-Engine
22

3+
v8.0.0 2025-06-26 (part of Zonemaster v2025.1 release)
4+
5+
[Breaking changes]
6+
- Changes the string representation of IPv6 addresses in "NS_CREATED"
7+
messages #1420
8+
- Separates functions to trim whitespace and to normalize domain
9+
name, respectively #1316
10+
11+
[Features]
12+
- Updates local copies of IANA special IP registries #1456
13+
- Lowers all WARNING to NOTICE for test case Zone01 #1455
14+
- Downgrades ERROR to WARNING in test case DNSSEC03 #1452
15+
- Improves performance by optimizing critical code sections #1420
16+
17+
[Fixes]
18+
- Updates translations (Danish, Norwegian) #1418, #1449
19+
- Updates Dockerfile for release 2025.1 #1460
20+
- Fixes test case DNSSEC10 for name servers sharing the same IPs #1457
21+
- Adds blacklisting log message #1434
22+
- Fixes alias (CNAME) handling in Address03 test case #1432
23+
24+
325
v7.1.0 2025-03-04 (part of Zonemaster v2024.2.1 release)
426

527
[Release information]

Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,31 @@ RUN apk add --no-cache \
1111
perl-module-build-tiny \
1212
# Compile-time dependencies
1313
perl-app-cpanminus \
14+
perl-class-accessor \
1415
perl-clone \
1516
perl-file-sharedir \
1617
perl-file-slurp \
1718
perl-io-socket-inet6 \
1819
perl-list-moreutils \
1920
perl-locale-msgfmt \
21+
perl-log-any \
2022
perl-lwp-protocol-https \
2123
perl-mail-spf \
2224
perl-module-install \
2325
perl-pod-coverage \
26+
perl-readonly \
2427
perl-sub-override \
2528
perl-test-differences \
2629
perl-test-exception \
2730
perl-test-fatal \
31+
perl-test-nowarnings \
2832
perl-test-pod \
2933
perl-text-csv \
34+
perl-yaml \
35+
perl-yaml-libyaml \
3036
&& cpanm --no-wget --from=https://cpan.metacpan.org/ \
3137
Email::Valid \
38+
List::Compare \
3239
Locale::PO \
3340
Locale::TextDomain \
3441
Module::Find \
@@ -51,15 +58,19 @@ RUN apk add --no-cache \
5158
# All the locales we need and more
5259
musl-locales \
5360
# Run-time dependencies
61+
perl-class-accessor \
5462
perl-clone \
5563
perl-file-sharedir \
5664
perl-file-slurp \
5765
perl-io-socket-inet6 \
5866
perl-list-moreutils \
5967
perl-locale-msgfmt \
68+
perl-log-any \
6069
perl-mail-spf \
6170
perl-mailtools \
6271
perl-module-install \
6372
perl-net-ip \
73+
perl-readonly \
6474
perl-text-csv \
65-
perl-try-tiny
75+
perl-try-tiny \
76+
perl-yaml-libyaml

MANIFEST

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ t/recursor-A.data
148148
t/recursor-A.t
149149
t/Test-address.data
150150
t/Test-address.t
151+
t/Test-address03.data
152+
t/Test-address03.t
151153
t/Test-basic.data
152154
t/Test-basic.t
153155
t/Test-basic01.data
154156
t/Test-basic01.t
155-
t/Test-basic02-A.data
156-
t/Test-basic02-A.t
157-
t/Test-basic02-B.data
158-
t/Test-basic02-B.t
157+
t/Test-basic02.data
158+
t/Test-basic02.t
159159
t/Test-connectivity.data
160160
t/Test-connectivity.t
161161
t/Test-connectivity03.data

MANIFEST.SKIP

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
^MYMETA\.
7272
#!end included /usr/share/perl/5.20/ExtUtils/MANIFEST.SKIP
7373

74+
# More Git configuration files
75+
\B\.gitattributes\b
76+
7477
# For GitHub action
7578
^\.github/
7679

Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ requires 'Net::IP::XS' => 0.21;
3434
requires 'Readonly' => 0;
3535
requires 'Text::CSV' => 0;
3636
requires 'YAML::XS' => 0;
37-
requires 'Zonemaster::LDNS' => 4.001000; # For v4.1.0
37+
requires 'Zonemaster::LDNS' => 5.000000; # For v5.0.0
3838

3939
test_requires 'Locale::PO' => 0;
4040
test_requires 'Pod::Coverage' => 0;

lib/Zonemaster/Engine.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Zonemaster::Engine;
33
use v5.16.0;
44
use warnings;
55

6-
use version; our $VERSION = version->declare("v7.1.0");
6+
use version; our $VERSION = version->declare("v8.0.0");
77

88
BEGIN {
99
# Locale::TextDomain (<= 1.20) doesn't know about File::ShareDir so give a helping hand.
@@ -231,6 +231,7 @@ sub reset {
231231
Zonemaster::Engine::Nameserver->empty_cache();
232232
$logger->clear_history() if $logger;
233233
Zonemaster::Engine::Recursor->clear_cache();
234+
Zonemaster::Engine::TestMethodsV2->clear_cache();
234235
return;
235236
}
236237

@@ -408,7 +409,8 @@ Set the logger's start time to the current time.
408409
=item reset()
409410
410411
Reset logger start time to current time, empty the list of log messages, clear
411-
nameserver object cache and recursor cache.
412+
nameserver object cache, clear recursor cache and clear all cached results of
413+
MethodsV2.
412414
413415
=back
414416

lib/Zonemaster/Engine/DNSName.pm

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ sub from_string {
2222
confess 'Argument must be a string: $domain'
2323
if !defined $domain || ref $domain ne '';
2424

25-
return $class->_new( { labels => [ split( /[.]/x, $domain ) ] } );
25+
my $obj = Class::Accessor::new( $class, { labels => [ split( /[.]/x, $domain ) ] } );
26+
27+
# We have the raw string, so we can precompute the string representation
28+
# easily and cheaply so it can be immediately returned by the string()
29+
# method instead of recomputing it from the labels list. The only thing we
30+
# need to do is to remove any trailing dot except if it’s the only
31+
# character.
32+
$obj->{_string} = ( $domain =~ s/.\K [.] \z//rx );
33+
34+
return $obj;
2635
}
2736

2837
sub new {
29-
my $proto = shift;
30-
confess "must be called with a single argument"
31-
if scalar( @_ ) != 1;
32-
my $input = shift;
38+
my ( $class, $input ) = @_;
3339

3440
my $attrs = {};
3541
if ( !defined $input ) {
@@ -39,7 +45,7 @@ sub new {
3945
$attrs->{labels} = \@{ $input->labels };
4046
}
4147
elsif ( blessed $input && $input->isa( 'Zonemaster::Engine::Zone' ) ) {
42-
$attrs->{labels} = [ split( /[.]/x, $input->name ) ];
48+
$attrs->{labels} = \@{ $input->name->labels };
4349
}
4450
elsif ( ref $input eq '' ) {
4551
$attrs->{labels} = [ split( /[.]/x, $input ) ];
@@ -62,31 +68,20 @@ sub new {
6268
confess "Unrecognized argument: " . $what;
6369
}
6470

65-
# Type constraints
66-
confess "Argument must be an ARRAYREF: labels"
67-
if exists $attrs->{labels}
68-
&& ref $attrs->{labels} ne 'ARRAY';
69-
70-
my $class = ref $proto || $proto;
71-
return $class->_new( $attrs );
72-
}
73-
74-
sub _new {
75-
my $class = shift;
76-
my $attrs = shift;
77-
78-
my $obj = Class::Accessor::new( $class, $attrs );
79-
80-
return $obj;
71+
return Class::Accessor::new( $class, $attrs );
8172
}
8273

8374
sub string {
8475
my $self = shift;
8576

86-
my $name = join( '.', @{ $self->labels } );
87-
$name = '.' if $name eq q{};
77+
if ( not exists $self->{_string} ) {
78+
my $string = join( '.', @{ $self->labels } );
79+
$string = '.' if $string eq q{};
80+
81+
$self->{_string} = $string;
82+
}
8883

89-
return $name;
84+
return $self->{_string};
9085
}
9186

9287
sub fqdn {
@@ -96,12 +91,21 @@ sub fqdn {
9691
}
9792

9893
sub str_cmp {
99-
my ( $self, $other ) = @_;
100-
$other //= q{}; # Treat undefined value as root
94+
# For performance reasons, we do not unpack @_.
95+
# As a reminder, the calling convention is my ( $self, $other, $swap ) = @_.
10196

102-
$other =~ s/(.+)[.]\z/$1/x;
97+
my $me = uc ( $_[0]->{_string} // $_[0]->string );
10398

104-
return ( uc( "$self" ) cmp uc( $other ) );
99+
# Treat undefined value as root
100+
my $other = $_[1] // q{};
101+
102+
if ( blessed $other and $other->isa( 'Zonemaster::Engine::DNSName' ) ) {
103+
return $me cmp uc( $other->{_string} // $other->string() );
104+
}
105+
else {
106+
# Assume $other is a string; remove trailing dot except if only character
107+
return $me cmp uc( $other =~ s/.\K [.] \z//xr );
108+
}
105109
}
106110

107111
sub next_higher {
@@ -183,7 +187,7 @@ A reference to a list of strings, being the labels the DNS name is made up from.
183187
184188
=over
185189
186-
=item new($input) _or_ new({ labels => \@labellist})
190+
=item new($input) _or_ new({ labels => \@labellist })
187191
188192
The constructor can be called with either a single argument or with a reference
189193
to a hash as in the example above.

0 commit comments

Comments
 (0)