mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-25 19:04:57 -05:00
Allow fallback to IDNA2003 processing
In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name. Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.
(cherry picked from commit 10923f9d87)
This commit is contained in:
parent
dca244b1c1
commit
efbdf81931
1 changed files with 8 additions and 1 deletions
|
|
@ -4480,6 +4480,9 @@ idn_locale_to_ace(const char *src, char *dst, size_t dstlen) {
|
|||
* valid domain name.
|
||||
*/
|
||||
res = idn2_to_ascii_lz(src, &ascii_src, IDN2_NONTRANSITIONAL);
|
||||
if (res == IDN2_DISALLOWED) {
|
||||
res = idn2_to_ascii_lz(src, &ascii_src, IDN2_TRANSITIONAL);
|
||||
}
|
||||
if (res != IDN2_OK) {
|
||||
fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnin",
|
||||
src, idn2_strerror(res));
|
||||
|
|
@ -4541,9 +4544,13 @@ idn_ace_to_locale(const char *src, char **dst) {
|
|||
}
|
||||
|
||||
/*
|
||||
* Then, check whether decoded 'src' is a valid IDNA2008 name.
|
||||
* Then, check whether decoded 'src' is a valid IDNA2008 name
|
||||
* and if disallowed character is found, fallback to IDNA2003.
|
||||
*/
|
||||
res = idn2_to_ascii_8z(utf8_src, NULL, IDN2_NONTRANSITIONAL);
|
||||
if (res == IDN2_DISALLOWED) {
|
||||
res = idn2_to_ascii_8z(utf8_src, NULL, IDN2_TRANSITIONAL);
|
||||
}
|
||||
if (res != IDN2_OK) {
|
||||
fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnout",
|
||||
src, idn2_strerror(res));
|
||||
|
|
|
|||
Loading…
Reference in a new issue