From ae73a8d87a25246d97382a36e4f83823fe4e58ff Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Wed, 9 Mar 2022 13:13:15 +0000 Subject: [PATCH] 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 --- CHANGES | 3 +++ bin/dig/dig.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7839b51d26..3a2ee1217f 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 7b4fd41274..756d38b0e8 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 */