1 diff -urN bind-9.2.3.org/bin/dig/dig.1 bind-9.2.3/bin/dig/dig.1
2 --- bind-9.2.3.org/bin/dig/dig.1 2003-10-24 23:31:26.000000000 +0200
3 +++ bind-9.2.3/bin/dig/dig.1 2003-10-24 23:46:54.000000000 +0200
5 \fI+noqr\fR which means that \fBdig\fR
6 will not print the initial query when it looks up the NS records for
10 +If \fBdig\fR has been built with IDN (internationalized
11 +domain name) support, it can accept and display non-ASCII domain names.
12 +\fBdig\fR appropriately converts character encoding of
13 +domain name before sending a request to DNS server or displaying a
14 +reply from the server.
15 +If you'd like to turn off the IDN support for some reason, defines
16 +the \fBIDN_DISABLE\fR environment variable.
17 +The IDN support is disabled if the the variable is set when
21 \fI/etc/resolv.conf\fR
22 diff -urN bind-9.2.3.org/bin/dig/dig.docbook bind-9.2.3/bin/dig/dig.docbook
23 --- bind-9.2.3.org/bin/dig/dig.docbook 2003-10-24 23:31:26.000000000 +0200
24 +++ bind-9.2.3/bin/dig/dig.docbook 2003-10-24 23:46:54.000000000 +0200
29 +<title>IDN SUPPORT</title>
31 +If <command>dig</command> has been built with IDN (internationalized
32 +domain name) support, it can accept and display non-ASCII domain names.
33 +<command>dig</command> appropriately converts character encoding of
34 +domain name before sending a request to DNS server or displaying a
35 +reply from the server.
36 +If you'd like to turn off the IDN support for some reason, defines
37 +the <envar>IDN_DISABLE</envar> environment variable.
38 +The IDN support is disabled if the the variable is set when
39 +<command>dig</command> runs.
46 <filename>/etc/resolv.conf</filename>
47 diff -urN bind-9.2.3.org/bin/dig/dighost.c bind-9.2.3/bin/dig/dighost.c
48 --- bind-9.2.3.org/bin/dig/dighost.c 2003-10-24 23:31:26.000000000 +0200
49 +++ bind-9.2.3/bin/dig/dighost.c 2003-10-24 23:46:54.000000000 +0200
59 +#include <idn/result.h>
61 +#include <idn/resconf.h>
65 #include <dns/byaddr.h>
66 #include <dns/fixedname.h>
67 #include <dns/message.h>
69 isc_mutex_t lookup_lock;
70 dig_lookup_t *current_lookup = NULL;
73 +static void initialize_idn(void);
74 +static isc_result_t output_filter(isc_buffer_t *buffer,
75 + unsigned int used_org,
76 + isc_boolean_t absolute);
77 +static idn_result_t append_textname(char *name, const char *origin,
79 +static void idn_check_result(idn_result_t r, const char *msg);
85 * Apply and clear locks at the event level in global task.
86 * Can I get rid of these using shutdown events? XXX
88 ISC_LIST_APPEND(server_list, srv, link);
97 else if (keysecret[0] != 0)
98 @@ -1202,6 +1229,14 @@
104 + char utf8_textname[MXNAME], utf8_origin[MXNAME], idn_textname[MXNAME];
108 + dns_name_settotextfilter(output_filter);
111 REQUIRE(lookup != NULL);
113 @@ -1230,6 +1265,17 @@
114 isc_buffer_init(&lookup->onamebuf, lookup->onamespace,
115 sizeof(lookup->onamespace));
119 + * We cannot convert `textname' and `origin' separately.
120 + * `textname' doesn't contain TLD, but local mapping needs
123 + mr = idn_encodename(IDN_LOCALCONV | IDN_DELIMMAP, lookup->textname,
124 + utf8_textname, sizeof(utf8_textname));
125 + idn_check_result(mr, "convert textname to UTF-8");
129 * If the name has too many dots, force the origin to be NULL
130 * (which produces an absolute lookup). Otherwise, take the origin
131 @@ -1238,12 +1284,41 @@
132 * is TRUE or we got a domain line in the resolv.conf file.
134 /* XXX New search here? */
136 + if ((count_dots(utf8_textname) >= ndots) || !usesearch)
137 + lookup->origin = NULL; /* Force abs lookup */
138 + else if (lookup->origin == NULL && lookup->new_search && usesearch) {
139 + lookup->origin = ISC_LIST_HEAD(search_list);
142 if ((count_dots(lookup->textname) >= ndots) || !usesearch)
143 lookup->origin = NULL; /* Force abs lookup */
144 else if (lookup->origin == NULL && lookup->new_search && usesearch) {
145 lookup->origin = ISC_LIST_HEAD(search_list);
150 if (lookup->origin != NULL) {
151 + mr = idn_encodename(IDN_LOCALCONV | IDN_DELIMMAP,
152 + lookup->origin->origin, utf8_origin,
153 + sizeof(utf8_origin));
154 + idn_check_result(mr, "convert origin to UTF-8");
155 + mr = append_textname(utf8_textname, utf8_origin,
156 + sizeof(utf8_textname));
157 + idn_check_result(mr, "append origin to textname");
159 + mr = idn_encodename(IDN_LOCALMAP | IDN_NAMEPREP |
160 + IDN_IDNCONV | IDN_LENCHECK, utf8_textname,
161 + idn_textname, sizeof(idn_textname));
162 + idn_check_result(mr, "convert UTF-8 textname to IDN encoding");
168 + if (lookup->origin != NULL) {
170 debug("trying origin %s", lookup->origin->origin);
171 result = dns_message_gettempname(lookup->sendmsg,
173 @@ -1288,6 +1363,15 @@
174 if (lookup->trace && lookup->trace_root)
175 dns_name_clone(dns_rootname, lookup->name);
178 + len = strlen(idn_textname);
179 + isc_buffer_init(&b, idn_textname, len);
180 + isc_buffer_add(&b, len);
181 + result = dns_name_fromtext(lookup->name, &b,
186 len = strlen(lookup->textname);
187 isc_buffer_init(&b, lookup->textname, len);
188 isc_buffer_add(&b, len);
189 @@ -1295,6 +1379,7 @@
195 if (result != ISC_R_SUCCESS) {
196 dns_message_puttempname(lookup->sendmsg,
197 @@ -2723,3 +2808,101 @@
199 isc_mem_destroy(&mctx);
204 +initialize_idn(void) {
207 +#ifdef HAVE_SETLOCALE
209 + (void)setlocale(LC_ALL, "");
211 + /* Create configuration context. */
212 + r = idn_nameinit(1);
213 + if (r != idn_success)
214 + fatal("idn api initialization failed: %s",
215 + idn_result_tostring(r));
217 + /* Set domain name -> text post-conversion filter. */
218 + dns_name_settotextfilter(output_filter);
222 +output_filter(isc_buffer_t *buffer, unsigned int used_org,
223 + isc_boolean_t absolute)
225 + char tmp1[MAXDLEN], tmp2[MAXDLEN];
226 + size_t fromlen, tolen;
227 + isc_boolean_t end_with_dot;
230 + * Copy contents of 'buffer' to 'tmp1', supply trailing dot
231 + * if 'absolute' is true, and terminate with NUL.
233 + fromlen = isc_buffer_usedlength(buffer) - used_org;
234 + if (fromlen >= MAXDLEN)
235 + return (ISC_R_SUCCESS);
236 + memcpy(tmp1, (char *)isc_buffer_base(buffer) + used_org, fromlen);
237 + end_with_dot = (tmp1[fromlen - 1] == '.') ? ISC_TRUE : ISC_FALSE;
238 + if (absolute && !end_with_dot) {
240 + if (fromlen >= MAXDLEN)
241 + return (ISC_R_SUCCESS);
242 + tmp1[fromlen - 1] = '.';
244 + tmp1[fromlen] = '\0';
247 + * Convert contents of 'tmp1' to local encoding.
249 + if (idn_decodename(IDN_DECODE_APP, tmp1, tmp2, MAXDLEN) != idn_success)
250 + return (ISC_R_SUCCESS);
251 + strcpy(tmp1, tmp2);
254 + * Copy the converted contents in 'tmp1' back to 'buffer'.
255 + * If we have appended trailing dot, remove it.
257 + tolen = strlen(tmp1);
258 + if (absolute && !end_with_dot && tmp1[tolen - 1] == '.')
261 + if (isc_buffer_length(buffer) < used_org + tolen)
262 + return (ISC_R_NOSPACE);
264 + isc_buffer_subtract(buffer, isc_buffer_usedlength(buffer) - used_org);
265 + memcpy(isc_buffer_used(buffer), tmp1, tolen);
266 + isc_buffer_add(buffer, tolen);
268 + return (ISC_R_SUCCESS);
272 +append_textname(char *name, const char *origin, size_t namesize) {
273 + size_t namelen = strlen(name);
274 + size_t originlen = strlen(origin);
276 + /* Already absolute? */
277 + if (namelen > 0 && name[namelen - 1] == '.')
278 + return idn_success;
280 + /* Append dot and origin */
282 + if (namelen + 1 + originlen >= namesize)
283 + return idn_buffer_overflow;
285 + name[namelen++] = '.';
286 + (void)strcpy(name + namelen, origin);
287 + return idn_success;
291 +idn_check_result(idn_result_t r, const char *msg) {
292 + if (r != idn_success) {
294 + fatal("%s: %s", msg, idn_result_tostring(r));
298 +#endif /* WITH_IDN */
299 diff -urN bind-9.2.3.org/bin/dig/host.1 bind-9.2.3/bin/dig/host.1
300 --- bind-9.2.3.org/bin/dig/host.1 2003-10-24 23:31:26.000000000 +0200
301 +++ bind-9.2.3/bin/dig/host.1 2003-10-24 23:46:54.000000000 +0200
303 effectively wait forever for a reply. The time to wait for a response
304 will be set to the number of seconds given by the hardware's maximum
305 value for an integer quantity.
308 +If \fBhost\fR has been built with IDN (internationalized
309 +domain name) support, it can accept and display non-ASCII domain names.
310 +\fBhost\fR appropriately converts character encoding of
311 +domain name before sending a request to DNS server or displaying a
312 +reply from the server.
313 +If you'd like to turn off the IDN support for some reason, defines
314 +the \fBIDN_DISABLE\fR environment variable.
315 +The IDN support is disabled if the the variable is set when
319 \fI/etc/resolv.conf\fR
320 diff -urN bind-9.2.3.org/bin/dig/host.docbook bind-9.2.3/bin/dig/host.docbook
321 --- bind-9.2.3.org/bin/dig/host.docbook 2003-10-24 23:31:26.000000000 +0200
322 +++ bind-9.2.3/bin/dig/host.docbook 2003-10-24 23:46:54.000000000 +0200
327 +<title>IDN SUPPORT</title>
329 +If <command>host</command> has been built with IDN (internationalized
330 +domain name) support, it can accept and display non-ASCII domain names.
331 +<command>host</command> appropriately converts character encoding of
332 +domain name before sending a request to DNS server or displaying a
333 +reply from the server.
334 +If you'd like to turn off the IDN support for some reason, defines
335 +the <envar>IDN_DISABLE</envar> environment variable.
336 +The IDN support is disabled if the the variable is set when
337 +<command>host</command> runs.
344 <filename>/etc/resolv.conf</filename>
345 diff -urN bind-9.2.3.org/bin/dig/Makefile.in bind-9.2.3/bin/dig/Makefile.in
346 --- bind-9.2.3.org/bin/dig/Makefile.in 2003-10-24 23:31:26.000000000 +0200
347 +++ bind-9.2.3/bin/dig/Makefile.in 2003-10-24 23:46:54.000000000 +0200
350 DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
352 -LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
353 +LIBS = ${DNSLIBS} ${ISCLIBS} @IDNLIBS@ @LIBS@
357 diff -urN bind-9.2.3.org/config.h.in bind-9.2.3/config.h.in
358 --- bind-9.2.3.org/config.h.in 2003-10-24 23:31:27.000000000 +0200
359 +++ bind-9.2.3/config.h.in 2003-10-24 23:46:54.000000000 +0200
361 /* define if you have strerror in the C library. */
364 +/* Define if you have the setlocale function. */
365 +#undef HAVE_SETLOCALE
367 /* Define to 1 if you have the <dlfcn.h> header file. */
371 /* Define to 1 if you have the <linux/capability.h> header file. */
372 #undef HAVE_LINUX_CAPABILITY_H
374 +/* Define if you have the <locale.h> header file. */
375 +#undef HAVE_LOCALE_H
377 /* Define to 1 if you have the <memory.h> header file. */
381 #undef HAVE_SYS_PRCTL_H
383 /* Define to 1 if you have the <sys/select.h> header file. */
385 +/* define if idnkit support is to be included. */
388 #undef HAVE_SYS_SELECT_H
390 /* Define to 1 if you have the <sys/sockio.h> header file. */
391 diff -urN bind-9.2.3.org/configure bind-9.2.3/configure
392 --- bind-9.2.3.org/configure 2003-10-24 23:31:27.000000000 +0200
393 +++ bind-9.2.3/configure 2003-10-24 23:46:55.000000000 +0200
394 @@ -1007,6 +1007,10 @@
395 --with-gnu-ld assume the C compiler uses GNU ld default=no
396 --with-pic try to use only PIC/non-PIC objects default=use both
397 --with-kame=PATH use Kame IPv6 default path /usr/local/v6
398 + --with-idn=MPREFIX enable IDN support using idnkit default PREFIX
399 + --with-libiconv=IPREFIX GNU libiconv are in IPREFIX default PREFIX
400 + --with-iconv=LIBSPEC specify iconv library default -liconv
401 + --with-idnlib=ARG specify libidnkit
403 Some influential environment variables:
404 CC C compiler command
405 @@ -13454,6 +13458,312 @@
412 +# Check whether --with-idn or --without-idn was given.
413 +if test "${with_idn+set}" = set; then
414 + withval="$with_idn"
421 + if test X$prefix = XNONE ; then
422 + idn_path=/usr/local
430 + idn_path="$use_idn"
437 +# Check whether --with-libiconv or --without-libiconv was given.
438 +if test "${with_libiconv+set}" = set; then
439 + withval="$with_libiconv"
440 + use_libiconv="$withval"
444 +case "$use_libiconv" in
446 + if test X$prefix = XNONE ; then
447 + iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
449 + iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
456 + iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
461 +# Check whether --with-iconv or --without-iconv was given.
462 +if test "${with_iconv+set}" = set; then
463 + withval="$with_iconv"
464 + iconvlib="$withval"
476 +# Check whether --with-idnlib or --without-idnlib was given.
477 +if test "${with_idnlib+set}" = set; then
478 + withval="$with_idnlib"
483 +if test "$idnlib" = yes; then
484 + { { echo "$as_me:$LINENO: error: You must specify ARG for --with-idnlib." >&5
485 +echo "$as_me: error: You must specify ARG for --with-idnlib." >&2;}
486 + { (exit 1); exit 1; }; }
490 +if test "$use_idn" != no; then
492 +cat >>confdefs.h <<\_ACEOF
496 + STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
497 + if test "$idnlib" != no; then
498 + IDNLIBS="$idnlib $iconvlib"
500 + IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
506 +for ac_header in locale.h
508 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
509 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
510 + echo "$as_me:$LINENO: checking for $ac_header" >&5
511 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
512 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
513 + echo $ECHO_N "(cached) $ECHO_C" >&6
515 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
516 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
518 + # Is the header compilable?
519 +echo "$as_me:$LINENO: checking $ac_header usability" >&5
520 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
521 +cat >conftest.$ac_ext <<_ACEOF
522 +#line $LINENO "configure"
523 +#include "confdefs.h"
524 +$ac_includes_default
525 +#include <$ac_header>
527 +rm -f conftest.$ac_objext
528 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
529 + (eval $ac_compile) 2>&5
531 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
532 + (exit $ac_status); } &&
533 + { ac_try='test -s conftest.$ac_objext'
534 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
535 + (eval $ac_try) 2>&5
537 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
538 + (exit $ac_status); }; }; then
539 + ac_header_compiler=yes
541 + echo "$as_me: failed program was:" >&5
542 +cat conftest.$ac_ext >&5
543 +ac_header_compiler=no
545 +rm -f conftest.$ac_objext conftest.$ac_ext
546 +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
547 +echo "${ECHO_T}$ac_header_compiler" >&6
549 +# Is the header present?
550 +echo "$as_me:$LINENO: checking $ac_header presence" >&5
551 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
552 +cat >conftest.$ac_ext <<_ACEOF
553 +#line $LINENO "configure"
554 +#include "confdefs.h"
555 +#include <$ac_header>
557 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
558 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
560 + egrep -v '^ *\+' conftest.er1 >conftest.err
562 + cat conftest.err >&5
563 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
564 + (exit $ac_status); } >/dev/null; then
565 + if test -s conftest.err; then
566 + ac_cpp_err=$ac_c_preproc_warn_flag
573 +if test -z "$ac_cpp_err"; then
574 + ac_header_preproc=yes
576 + echo "$as_me: failed program was:" >&5
577 + cat conftest.$ac_ext >&5
578 + ac_header_preproc=no
580 +rm -f conftest.err conftest.$ac_ext
581 +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
582 +echo "${ECHO_T}$ac_header_preproc" >&6
584 +# So? What about this header?
585 +case $ac_header_compiler:$ac_header_preproc in
587 + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
588 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
589 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
590 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
592 + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
593 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
594 + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
595 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
596 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
597 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
599 +echo "$as_me:$LINENO: checking for $ac_header" >&5
600 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
601 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
602 + echo $ECHO_N "(cached) $ECHO_C" >&6
604 + eval "$as_ac_Header=$ac_header_preproc"
606 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
607 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
610 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
611 + cat >>confdefs.h <<_ACEOF
612 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
620 +for ac_func in setlocale
622 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
623 +echo "$as_me:$LINENO: checking for $ac_func" >&5
624 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
625 +if eval "test \"\${$as_ac_var+set}\" = set"; then
626 + echo $ECHO_N "(cached) $ECHO_C" >&6
628 + cat >conftest.$ac_ext <<_ACEOF
629 +#line $LINENO "configure"
630 +#include "confdefs.h"
631 +/* From autoconf 2.57 */
632 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
633 + For example, HP-UX 11i <limits.h> declares gettimeofday. */
634 +#define $ac_func innocuous_$ac_func
636 +/* System header to define __stub macros and hopefully few prototypes,
637 + which can conflict with char $ac_func (); below.
638 + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
639 + <limits.h> exists even on freestanding compilers. */
642 +# include <limits.h>
644 +# include <assert.h>
649 +/* Override any gcc2 internal prototype to avoid an error. */
654 +/* We use char because int might match the return type of a gcc2
655 + builtin and then its argument prototype would still apply. */
657 +/* The GNU C library defines this for functions which it implements
658 + to always fail with ENOSYS. Some functions are actually named
659 + something starting with __ and the normal name is an alias. */
660 +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
663 +char (*f) () = $ac_func;
669 +#ifdef F77_DUMMY_MAIN
673 + int F77_DUMMY_MAIN() { return 1; }
678 +return f != $ac_func;
683 +rm -f conftest.$ac_objext conftest$ac_exeext
684 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
685 + (eval $ac_link) 2>&5
687 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
688 + (exit $ac_status); } &&
689 + { ac_try='test -s conftest$ac_exeext'
690 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
691 + (eval $ac_try) 2>&5
693 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
694 + (exit $ac_status); }; }; then
695 + eval "$as_ac_var=yes"
697 + echo "$as_me: failed program was:" >&5
698 +cat conftest.$ac_ext >&5
699 +eval "$as_ac_var=no"
701 +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
703 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
704 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
705 +if test `eval echo '${'$as_ac_var'}'` = yes; then
706 + cat >>confdefs.h <<_ACEOF
707 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
718 @@ -14247,6 +14557,7 @@
719 s,@PRINTSTYLE@,$PRINTSTYLE,;t t
720 s,@XMLDCL@,$XMLDCL,;t t
721 s,@DOCBOOK2MANSPEC@,$DOCBOOK2MANSPEC,;t t
722 +s,@IDNLIBS@,$IDNLIBS,;t t
723 s,@BIND9_TOP_BUILDDIR@,$BIND9_TOP_BUILDDIR,;t t
724 s,@BIND9_ISC_BUILDINCLUDE@,$BIND9_ISC_BUILDINCLUDE,;t t
725 s,@BIND9_ISCCC_BUILDINCLUDE@,$BIND9_ISCCC_BUILDINCLUDE,;t t
726 diff -urN bind-9.2.3.org/configure.in bind-9.2.3/configure.in
727 --- bind-9.2.3.org/configure.in 2003-10-24 23:31:27.000000000 +0200
728 +++ bind-9.2.3/configure.in 2003-10-24 23:46:55.000000000 +0200
729 @@ -1695,6 +1695,82 @@
730 NOM_PATH_FILE(DOCBOOK2MANSPEC, docbook2X/docbook2man-spec.pl, $sgmltrees)
736 + [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
737 + use_idn="$withval", use_idn="no")
740 + if test X$prefix = XNONE ; then
741 + idn_path=/usr/local
749 + idn_path="$use_idn"
755 +AC_ARG_WITH(libiconv,
756 + [ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
757 + use_libiconv="$withval", use_libiconv="no")
758 +case "$use_libiconv" in
760 + if test X$prefix = XNONE ; then
761 + iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
763 + iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
770 + iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
775 + [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
776 + iconvlib="$withval")
787 + [ --with-idnlib=ARG specify libidnkit],
788 + idnlib="$withval", idnlib="no")
789 +if test "$idnlib" = yes; then
790 + AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
794 +if test "$use_idn" != no; then
795 + AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
796 + STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
797 + if test "$idnlib" != no; then
798 + IDNLIBS="$idnlib $iconvlib"
800 + IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
805 +AC_CHECK_HEADERS(locale.h)
806 +AC_CHECK_FUNCS(setlocale)
811 AC_SUBST(BIND9_TOP_BUILDDIR)
812 diff -urN bind-9.2.3.org/lib/dns/include/dns/name.h bind-9.2.3/lib/dns/include/dns/name.h
813 --- bind-9.2.3.org/lib/dns/include/dns/name.h 2003-10-24 23:31:34.000000000 +0200
814 +++ bind-9.2.3/lib/dns/include/dns/name.h 2003-10-24 23:46:54.000000000 +0200
817 #define DNS_NAME_MAXWIRE 255
821 + * Text output filter procedure.
822 + * 'target' is the buffer to be converted. The region to be converted
823 + * is from 'buffer'->base + 'used_org' to the end of the used region.
825 +typedef isc_result_t (*dns_name_totextfilter_t)(isc_buffer_t *target,
826 + unsigned int used_org,
827 + isc_boolean_t absolute);
833 @@ -1261,6 +1272,14 @@
839 +dns_name_settotextfilter(dns_name_totextfilter_t proc);
841 + * Call 'proc' at the end of dns_name_totext.
843 +#endif /* WITH_IDN */
845 #define DNS_NAME_FORMATSIZE (DNS_NAME_MAXTEXT + 1)
847 * Suggested size of buffer passed to dns_name_format().
848 diff -urN bind-9.2.3.org/lib/dns/name.c bind-9.2.3/lib/dns/name.c
849 --- bind-9.2.3.org/lib/dns/name.c 2003-10-24 23:31:34.000000000 +0200
850 +++ bind-9.2.3/lib/dns/name.c 2003-10-24 23:46:54.000000000 +0200
852 /* XXXDCL make const? */
853 dns_name_t *dns_wildcardname = &wild;
857 + * dns_name_t to text post-conversion procedure.
859 +static dns_name_totextfilter_t totext_filter_proc = NULL;
863 set_offsets(const dns_name_t *name, unsigned char *offsets,
864 dns_name_t *set_name);
865 @@ -1699,6 +1706,9 @@
867 isc_boolean_t saw_root = ISC_FALSE;
870 + unsigned int oused = target->used;
874 * This function assumes the name is in proper uncompressed
875 @@ -1876,6 +1886,10 @@
877 isc_buffer_add(target, tlen - trem);
880 + if (totext_filter_proc != NULL)
881 + return ((*totext_filter_proc)(target, oused, saw_root));
883 return (ISC_R_SUCCESS);
886 @@ -3340,3 +3354,9 @@
887 return (ISC_R_SUCCESS);
892 +dns_name_settotextfilter(dns_name_totextfilter_t proc) {
893 + totext_filter_proc = proc;
896 diff -urN bind-9.2.3.org/README.idnkit bind-9.2.3/README.idnkit
897 --- bind-9.2.3.org/README.idnkit 1970-01-01 01:00:00.000000000 +0100
898 +++ bind-9.2.3/README.idnkit 2003-10-24 23:46:54.000000000 +0200
903 + Japan Network Information Center (JPNIC)
906 +* What is this patch for?
908 +This patch adds internationalized domain name (IDN) support to BIND-9.
909 +You'll get internationalized version of dig/host/nslookup commands.
911 + + internationalized dig/host/nslookup
912 + dig/host/nslookup accepts non-ASCII domain names in the local
913 + codeset (such as Shift JIS, Big5 or ISO8859-1) determined by
914 + the locale information. The domain names are normalized and
915 + converted to the encoding on the DNS protocol, and sent to DNS
916 + servers. The replies are converted back to the local codeset
920 +* Compilation & installation
924 +You have to build and install idnkit before building this patched version
927 +1. Running configure script
929 +Run `configure' in the top directory. See `README' for the
930 +configuration options.
932 +This patch adds the following 4 options to `configure'. You should
933 +at least specify `--with-idn' option to enable IDN support.
935 + --with-idn[=IDN_PREFIX]
936 + To enable IDN support, you have to specify `--with-idn' option.
937 + The argument IDN_PREFIX is the install prefix of idnkit. If
938 + IDN_PREFIX is omitted, PREFIX (derived from `--prefix=PREFIX')
941 + --with-libiconv[=LIBICONV_PREFIX]
942 + Specify this option if idnkit you have installed links GNU
943 + libiconv. The argument LIBICONV_PREFIX is install prefix of
944 + GNU libiconv. If the argument is omitted, PREFIX (derived
945 + from `--prefix=PREFIX') is assumed.
947 + `--with-libiconv' is shorthand option for GNU libiconv.
949 + --with-libiconv=/usr/local
951 + This is equivalent to:
953 + --with-iconv='-L/usr/local/lib -R/usr/local/lib -liconv'
955 + `--with-libiconv' assumes that your C compiler has `-R'
956 + option, and that the option adds the specified run-time path
957 + to an exacutable binary. If `-R' option of your compiler has
958 + different meaning, or your compiler lacks the option, you
959 + should use `--with-iconv' option instead. Binary command
960 + without run-time path information might be unexecutable.
961 + In that case, you would see an error message like:
963 + error in loading shared libraries: libiconv.so.2: cannot
964 + open shared object file
966 + If both `--with-libiconv' and `--with-iconv' options are
967 + specified, `--with-iconv' is prior to `--with-libiconv'.
969 + --with-iconv=ICONV_LIBSPEC
970 + If your libc doens't provide iconv(), you need to specify the
971 + library containing iconv() with this option. `ICONV_LIBSPEC'
972 + is the argument(s) to `cc' or `ld' to link the library, for
973 + example, `--with-iconv="-L/usr/local/lib -liconv"'.
974 + You don't need to specify the header file directory for "iconv.h"
975 + to the compiler, as it isn't included directly by bind-9 with
978 + --with-idnlib=IDN_LIBSPEC
979 + With this option, you can explicitly specify the argument(s)
980 + to `cc' or `ld' to link the idnkit's library, `libidnkit'. If
981 + this option is not specified, `-L${PREFIX}/lib -lidnkit' is
982 + assumed, where ${PREFIX} is the installation prefix specified
983 + with `--with-idn' option above. You may need to use this
984 + option to specify extra argments, for example,
985 + `--with-idnlib="-L/usr/local/lib -R/usr/local/lib -lidnkit"'.
987 +Please consult `README' for other configuration options.
989 +Note that if you want to specify some extra header file directories,
990 +you should use the environment variable STD_CINCLUDES instead of
991 +CFLAGS, as described in README.
993 +2. Compilation and installation
995 +After running "configure", just do
1000 +for compiling and installing.
1003 +* Contact information
1005 +Please see http//www.nic.ad.jp/en/idn/ for the latest news
1006 +about idnkit and this patch.
1008 +Bug reports and comments on this kit should be sent to
1009 +mdnkit-bugs@nic.ad.jp and idn-cmt@nic.ad.jp, respectively.