Open JyJyJcr opened 2 days ago
Describe the bug /etc/resolv.conf with non-LDH escape sequence causes parse error.
/etc/resolv.conf
To Reproduce
\
hickory-resolver
Simplest example:
add space\032space.com into domain search list, then
space\032space.com
cargo install hickory-util resolve -s github.com
will fail with this error:
Error: ResolveError { kind: Io(Custom { kind: Other, error: "Error parsing resolv.conf: Malformed label: space\u{1a}space" }) }
Expected behavior
resolv.conf
expected result of the example above:
1.
Querying for github.com A from [system provided nameservers...] Success for query github.com IN A github.com. 51 IN A 20.27.177.113
2.
Error: ResolveError { kind: Io(Custom { kind: Other, error: "Error parsing resolv.conf: Malformed label: space\u{20}space" }) }
System: 1.
Version: Crate: hickory-resolver Version: 0.24.1
Additional context when domain search list with non LDH characters provided, some DHCP client implementations use \-escape decimal sequences and put the escaped domains into /etc/resolv.conf:
This behavior corresponds with non-LDH escape defined in Section 2.1 of RFC 4343.
Strangely, ISC-DHCP use C-style octal escape sequence:
https://github.com/hickory-dns/hickory-dns/pull/330 seems following ISC-DHCP.
Describe the bug
/etc/resolv.conf
with non-LDH escape sequence causes parse error.To Reproduce
\
-escape sequence to/etc/resolv.conf
hickory-resolver
crate as the resolver/etc/resolv.conf
Simplest example:
add
space\032space.com
into domain search list, thenwill fail with this error:
Expected behavior
resolv.conf
as vaild fileexpected result of the example above:
1.
2.
System: 1.
Version: Crate: hickory-resolver Version: 0.24.1
Additional context when domain search list with non LDH characters provided, some DHCP client implementations use
\
-escape decimal sequences and put the escaped domains into/etc/resolv.conf
:This behavior corresponds with non-LDH escape defined in Section 2.1 of RFC 4343.
Strangely, ISC-DHCP use C-style octal escape sequence:
https://github.com/hickory-dns/hickory-dns/pull/330 seems following ISC-DHCP.