]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Stop dig complaining about +noidn when it can't IDN
authorTony Finch <dot@dotat.at>
Wed, 9 Mar 2022 13:13:15 +0000 (13:13 +0000)
committerTony Finch <dot@dotat.at>
Wed, 9 Mar 2022 13:13:15 +0000 (13:13 +0000)
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
bin/dig/dig.c

diff --git a/CHANGES b/CHANGES
index 7839b51d2622e7ad46e6479bfeea8159b8904363..3a2ee1217f1c74a91e87a7829b9b92622c481894 100644 (file)
--- 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]
index 7b4fd41274613abebb341dccca3a67b514b83343..756d38b0e83d572e475e2dc4f814b9fefeae7bda 100644 (file)
@@ -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 */