From: Tony Finch Date: Wed, 9 Mar 2022 13:13:15 +0000 (+0000) Subject: Stop dig complaining about +noidn when it can't IDN X-Git-Tag: v9.19.0~74^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ae73a8d87a25246d97382a36e4f83823fe4e58ff;p=thirdparty%2Fbind9.git Stop dig complaining about +noidn when it can't IDN When dig was built without IDN support, it reported an error if the +noidnin and/or +noidnout options were used. This means the options were not useful for a script that wants consistent lack of IDN translation regardless of how BIND is built. Make dig complain about lack of built-in IDN support only when the user asks for IDN translation. Closes #3188 --- diff --git a/CHANGES b/CHANGES index 7839b51d262..3a2ee1217f1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5826. [cleanup] Stop dig from complaining about lack of IDN support when + the user asks for no IDN translation. [GL #3188] + 5825. [funcf] Set the minimum MTU on UDPv6 and TCPv6 sockets and limit TCP maximum segment size (TCP_MAXSEG) to (1220) for both TCPv4 and TCPv6 sockets. [GL #2201] diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 7b4fd412746..756d38b0e83 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -1515,8 +1515,11 @@ plus_option(char *option, bool is_batchfile, bool *need_clone, case 'i': FULLCHECK("idnin"); #ifndef HAVE_LIBIDN2 - fprintf(stderr, ";; IDN input support" + if (state) { + fprintf(stderr, + ";; IDN input support" " not enabled\n"); + } #else /* ifndef HAVE_LIBIDN2 */ lookup->idnin = state; #endif /* ifndef HAVE_LIBIDN2 */ @@ -1524,8 +1527,11 @@ plus_option(char *option, bool is_batchfile, bool *need_clone, case 'o': FULLCHECK("idnout"); #ifndef HAVE_LIBIDN2 - fprintf(stderr, ";; IDN output support" + if (state) { + fprintf(stderr, + ";; IDN output support" " not enabled\n"); + } #else /* ifndef HAVE_LIBIDN2 */ lookup->idnout = state; #endif /* ifndef HAVE_LIBIDN2 */