]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2141. [bug] dig/host should not be setting IDN_ASCCHECK (IDN
authorMark Andrews <marka@isc.org>
Mon, 26 Feb 2007 00:27:09 +0000 (00:27 +0000)
committerMark Andrews <marka@isc.org>
Mon, 26 Feb 2007 00:27:09 +0000 (00:27 +0000)
                        equivalent of LDH checks).  [RT #16609]

CHANGES
bin/dig/dighost.c
bin/dig/host.c
bin/dig/include/dig/dig.h

diff --git a/CHANGES b/CHANGES
index 2cb620ebc339190a584ea6f66041c9042ebc8db9..60d21bd3b347c4afe04cc02b0291573b91c11575 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2141.  [bug]           dig/host should not be setting IDN_ASCCHECK (IDN
+                       equivalent of LDH checks).  [RT #16609]
+
 2140.  [bug]           libbind: missing unlock on pthread_key_create()
                        failures. [RT #16654]
 
index ee3a0a6ed241bdc8f81e5f34c0ea4e006e02135a..b2139495cfda38096b121ecb79a6b369aa5d1e96 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.299 2007/02/14 23:45:44 marka Exp $ */
+/* $Id: dighost.c,v 1.300 2007/02/26 00:27:09 marka Exp $ */
 
 /*! \file
  *  \note
@@ -144,6 +144,7 @@ static idn_result_t append_textname(char *name, const char *origin,
 static void            idn_check_result(idn_result_t r, const char *msg);
 
 #define MAXDLEN                256
+int  idnoptions        = 0;
 #endif
 
 /*%
@@ -1816,7 +1817,7 @@ setup_lookup(dig_lookup_t *lookup) {
                                     sizeof(utf8_textname));
                idn_check_result(mr, "append origin to textname");
        }
-       mr = idn_encodename(IDN_LOCALMAP | IDN_NAMEPREP | IDN_ASCCHECK |
+       mr = idn_encodename(idnoptions | IDN_LOCALMAP | IDN_NAMEPREP |
                            IDN_IDNCONV | IDN_LENCHECK, utf8_textname,
                            idn_textname, sizeof(idn_textname));
        idn_check_result(mr, "convert UTF-8 textname to IDN encoding");
index ce92eb5ca217affb3a5549aacff5a1bf3703ff90..2059eba4b7306a77f34b3ee7c20fd8f7a559b0f8 100644 (file)
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: host.c,v 1.110 2006/05/23 04:38:28 marka Exp $ */
+/* $Id: host.c,v 1.111 2007/02/26 00:27:09 marka Exp $ */
 
 /*! \file */
 
 #include <config.h>
+#include <stdlib.h>
 #include <limits.h>
 
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#ifdef WITH_IDN
+#include <idn/result.h>
+#include <idn/log.h>
+#include <idn/resconf.h>
+#include <idn/api.h>
+#endif
+
 #include <isc/app.h>
 #include <isc/commandline.h>
 #include <isc/netaddr.h>
@@ -664,6 +676,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
                            lookup->rdtype != dns_rdatatype_axfr)
                                lookup->rdtype = rdtype;
                        lookup->rdtypeset = ISC_TRUE;
+#ifdef WITH_IDN
+                       idnoptions = 0;
+#endif
                        if (rdtype == dns_rdatatype_axfr) {
                                /* -l -t any -v */
                                list_type = dns_rdatatype_any;
@@ -672,6 +687,13 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
                        } else if (rdtype == dns_rdatatype_ixfr) {
                                lookup->ixfr_serial = serial;
                                list_type = rdtype;
+#ifdef WITH_IDN
+                       } else if (rdtype == dns_rdatatype_a ||
+                                  rdtype == dns_rdatatype_aaaa ||
+                                  rdtype == dns_rdatatype_mx) {
+                               idnoptions = IDN_ASCCHECK;
+                               list_type = rdtype;
+#endif
                        } else
                                list_type = rdtype;
                        list_addresses = ISC_FALSE;
@@ -814,6 +836,9 @@ main(int argc, char **argv) {
        ISC_LIST_INIT(search_list);
        
        fatalexit = 1;
+#ifdef WITH_IDN
+       idnoptions = IDN_ASCCHECK;
+#endif
 
        debug("main()");
        progname = argv[0];
index af2a1dac1ce76e45bbd3ceb075e38b86e700d3d7..ac14aece54cac3358817258d3e25a2eec71dacf5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dig.h,v 1.101 2006/12/07 05:52:16 marka Exp $ */
+/* $Id: dig.h,v 1.102 2007/02/26 00:27:09 marka Exp $ */
 
 #ifndef DIG_H
 #define DIG_H
@@ -277,6 +277,9 @@ extern isc_boolean_t debugging, memdebugging;
 extern char *progname;
 extern int tries;
 extern int fatalexit;
+#ifdef WITH_IDN
+extern int idnoptions;
+#endif
 
 /*
  * Routines in dighost.c.