-
Notifications
You must be signed in to change notification settings - Fork 36
Fix Basic01 #1270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Basic01 #1270
Conversation
|
@matsduf I can see that branch |
Yes, that is intentional. v2023.1.3 should not include other things that have been merged to develop branch after the latest release, only the fixes for that fix release. |
|
Unit tests are failing (on Ubuntu), while it works fine on my computer (Debian). I can see where the error is supposed to be from the logs but unsure as to why it happens yet. |
Commit f1354e1 (zonemaster#1249) introduced a bug (regression) when comparing domain names. It was using the function 'index()' to make such a comparison, on names that were no longer in their FQDN form. Thus, any domain name beginning with the characters of its TLD (e.g. 'norid.no') would wrongly be discarded. But even if that bug was reverted, it could still be problematic for multi-level zones, e.g. 'no.norid.no'. So, instead of relying on a pure Perl function that does string comparison, in this commit we make use of the Zonemaster::Engine::DNSName class, specifically its functions 'common()' and 'is_in_bailiwick', to count and compare the labels composing domain names.
So the error was due to the fact that chained comparisons support was only added in Perl v5.32 (see https://metacpan.org/release/XSAWYERX/perl-5.32.0/view/pod/perldelta.pod#Chained-comparisons-capability). I have provided an update to the code in that regard. |
matsduf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have installed and tested the new code and it seems to behave correctly. The code of method basic01() is quite hard to follow. Could it be give some more documentation to make it easier to follow it?
I think we can proceed as is. The code is following the specification to the letter, so I don't know what more I can add in that regard. |
Purpose
This PR updates Basic01 to fix a bug (regression) introduced in the latest fix release by PR #1249.
Context
Fixes #1269
Changes
Use functions Zonemaster::Engine::DNSName::common() and Zonemaster::Engine::DNSName::is_in_bailiwick() instead of index() to make domain names comparison.
Refactoring.
How to test this PR
Tests should pass.
Also: