mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #821] Name and Label parsing still to restrictive, allow \" #546
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#546
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bluejekyll on GitHub (Jul 1, 2019).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/821
Currently " is not accepted in Label parsing.
In this funtion:
https://github.com/bluejekyll/trust-dns/blob/master/crates/proto/src/rr/domain/label.rs#L215
We should 1) better document what these flags do. 2) perhaps change the default match case
_to be the same as., where when it's being encoded it must be escaped.Consider refactoring that function to rather than taking booleans, return an enum that represents if the character needs to be encoded, and or is safe/not-safe in standard names.
@ppentchev commented on GitHub (Jun 12, 2022):
Hi,
First of all, thanks a lot for writing and maintaining the trust-dns suite! It is very useful and very well-designed.
I'm not sure if what I am asking is really a good idea, but I tried implementing a simple client for the https://www.dns.toys/ API and it was all fine and good right up to the point where the API requires the use of a slash as a delimiter between the city name and the two-letter country code. You can probably see where this is going:
Name::from_str()simply refuses to allow me to do that :)Yes, I have pretty much grown up with the DNS RFCs, I actually remember people complaining about 2600.com back in the nineties, and I have filed tickets with ISPs for using slashes in the names of their routers, breaking my too-strict-for-my-own-good diagnostic tools. So... yeah. I don't know if it is a good idea, and if you feel that "nah, please go talk to the dns.toys maintainers, let them fix their API" is the proper response, I will accept it. Still, I thought I'd ask :)
Thanks again, and keep up the great work!
G'luck,
Peter
@bluejekyll commented on GitHub (Jun 12, 2022):
Those are some interesting examples, I believe this is the one you're talking about?
dig paris/fr.time @dns.toysI've been tempted in the past to remove a lot of the restrictions we have on the names that we parse, this is a good example. We could easily allow this here: https://github.com/bluejekyll/trust-dns/blob/main/crates/proto/src/rr/domain/label.rs#L225
I'm not familiar with that usage, but I don't seen an explicit reason for disallowing
/, especially if it's in common usage like this.@ppentchev commented on GitHub (Jun 14, 2022):
Hi,
Thanks for the quick answer, and sorry it took me a while to reply. So, hm. Yeah, I could try to whip up a simple patch to allow some specific characters (a slash? what else?) if that's what you think is right. Or, if you want, I could try to do something in the direction of your original message here - allow everything, but escape it as necessary. Or, on the gripping hand, I could try to make something a bit more complex, like a builder pattern - there would probably have to be one for labels and also one for names that either copies most of the options or knows how to use a label builder.
So... which of these three ways would you prefer? Or is it more like "none of the above"? :)
G'luck,
Peter