-
Notifications
You must be signed in to change notification settings - Fork 919
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 12748862565Details
💛 - 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: |
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. |
2042465
to
98be793
Compare
I reworked this now that adding a RR for a name that doesn't end in $zone uses the relative name (with a warning) and interprets as absolute otherwise. IMHO this is a tad nicer than erroring out (which was what we discussed on irc). With the warning added today, we can drop the relative interpretation in a later release with less expected fallout (assuming people read the warning and adapt their usage). |
98be793
to
a372dae
Compare
…th . or ZONE 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. Also make both pdnsutil --config-dir=configs/auth add-record example.net www.example.net A 1.2.3.5 pdnsutil --config-dir=configs/auth add-record example.net www A 1.2.3.5 add www.example.net. to the example.net zone. Closes: PowerDNS#8595
boost:ends_with(qname, ".") behaves exactly as isCanonical(qname) should. So use the first to implement the latter.
3714bab
to
5f8af39
Compare
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: