-
Notifications
You must be signed in to change notification settings - Fork 921
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
pdnsutil {add-record,delete-rrset}: Don't append ZONE if NAME ends with . #14984
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12399833537Details
💛 - Coveralls |
0429faf
to
a878c70
Compare
Pushed with using |
Fix the respective calls in a test and the docs according to the now explicit recommendation. Using NAME=@ is the condition that is explicitly treated for that purpose in the code. Currently NAME='' and NAME=. have the same effect.
a878c70
to
5b56440
Compare
Add and delete record in pdnsutil are already somewhat special for pdns with the relative names. I'm not sure we should make them even more special by adding canonical logic. If we touch this, I prefer switching to full names here like the rest of pdns and drop all the fiddling with apex canonical and/or relative names. |
The failing check is clang-tidy which wants me to use { } around the if bodies: |
…th . If a NAME ends with a . it is to be understood as an absolute name and appending the zone is not intuitive then. Note this changes behaviour for calls like: pdnsutil --config-dir=configs/auth add-record example.net . NS 1.2.3.4 which added the NS record to the zone's apex before and is likely an error now. Closes: PowerDNS#8595
boost:ends_with(qname, ".") behaves exactly as isCanonical(qname) should. So use the first to implement the latter.
5b56440
to
2042465
Compare
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.
LGTM
I have to say I like this, except for breaking compatibility. But I agree the old form confuses people (including myself) all the time. And it in fact simplifies the code. |
If a NAME ends with a . it is to be understood as an absolute name and appending the zone is not intuitive then.
Closes: #8595
Checklist
I have: