]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Emit warning on IDN output failure
authorPetr Menšík <pemensik@redhat.com>
Wed, 30 Jan 2019 14:38:54 +0000 (15:38 +0100)
committerOndřej Surý <ondrej@sury.org>
Mon, 30 Sep 2019 09:53:28 +0000 (11:53 +0200)
Warning is emitted before any dig headers.

(cherry picked from commit 21371abd729e1dac0565425f1d5330c181c401ee)

bin/dig/dighost.c

index 1aab4f2c7f9ea153486be5afe505fb6c8cbe28f7..3efe6a243bdb13c82abf271ee20a1e48b82e973f 100644 (file)
@@ -4379,16 +4379,19 @@ idn_ace_to_locale(const char *src, char **dst) {
         */
        res = idn2_to_unicode_8zlz(utf8_src, &local_src, 0);
        if (res != IDN2_OK) {
-               /*
-                * Cannot represent in current locale.
-                * Output ACE form undecoded.
-                */
+               static bool warned = false;
+
                res = idn2_to_ascii_8z(utf8_src, &local_src, 0);
                if (res != IDN2_OK) {
                        fatal("Cannot represent '%s' "
                              "in the current locale nor ascii (%s), "
                              "use +noidnout or a different locale",
                              src, idn2_strerror(res));
+               } else if (!warned) {
+                       fprintf(stderr, ";; Warning: cannot represent '%s' "
+                             "in the current locale",
+                             local_src);
+                       warned = true;
                }
        }