1
IDN patch for bind-9.3.0
2
========================
5
This is a patch file for ISC BIND 9.3.0 to make it work with
6
internationalized domain names. With this patch you'll get IDN-aware
9
To apply this patch, you should go to the top directory of the BIND
10
distribution (where you see `README' file), then invoke `patch'
13
% patch -p0 < this-file
15
Then follow the instructions described in `README.idnkit' to compile
20
--- /dev/null Wed Sep 1 17:46:18 2004
21
+++ README.idnkit Wed Sep 1 17:36:14 2004
26
+ Japan Network Information Center (JPNIC)
29
+* What is this patch for?
31
+This patch adds internationalized domain name (IDN) support to BIND-9.
32
+You'll get internationalized version of dig/host/nslookup commands.
34
+ + internationalized dig/host/nslookup
35
+ dig/host/nslookup accepts non-ASCII domain names in the local
36
+ codeset (such as Shift JIS, Big5 or ISO8859-1) determined by
37
+ the locale information. The domain names are normalized and
38
+ converted to the encoding on the DNS protocol, and sent to DNS
39
+ servers. The replies are converted back to the local codeset
43
+* Compilation & installation
47
+You have to build and install idnkit before building this patched version
50
+1. Running configure script
52
+Run `configure' in the top directory. See `README' for the
53
+configuration options.
55
+This patch adds the following 4 options to `configure'. You should
56
+at least specify `--with-idn' option to enable IDN support.
58
+ --with-idn[=IDN_PREFIX]
59
+ To enable IDN support, you have to specify `--with-idn' option.
60
+ The argument IDN_PREFIX is the install prefix of idnkit. If
61
+ IDN_PREFIX is omitted, PREFIX (derived from `--prefix=PREFIX')
64
+ --with-libiconv[=LIBICONV_PREFIX]
65
+ Specify this option if idnkit you have installed links GNU
66
+ libiconv. The argument LIBICONV_PREFIX is install prefix of
67
+ GNU libiconv. If the argument is omitted, PREFIX (derived
68
+ from `--prefix=PREFIX') is assumed.
70
+ `--with-libiconv' is shorthand option for GNU libiconv.
72
+ --with-libiconv=/usr/local
74
+ This is equivalent to:
76
+ --with-iconv='-L/usr/local/lib -R/usr/local/lib -liconv'
78
+ `--with-libiconv' assumes that your C compiler has `-R'
79
+ option, and that the option adds the specified run-time path
80
+ to an exacutable binary. If `-R' option of your compiler has
81
+ different meaning, or your compiler lacks the option, you
82
+ should use `--with-iconv' option instead. Binary command
83
+ without run-time path information might be unexecutable.
84
+ In that case, you would see an error message like:
86
+ error in loading shared libraries: libiconv.so.2: cannot
87
+ open shared object file
89
+ If both `--with-libiconv' and `--with-iconv' options are
90
+ specified, `--with-iconv' is prior to `--with-libiconv'.
92
+ --with-iconv=ICONV_LIBSPEC
93
+ If your libc doens't provide iconv(), you need to specify the
94
+ library containing iconv() with this option. `ICONV_LIBSPEC'
95
+ is the argument(s) to `cc' or `ld' to link the library, for
96
+ example, `--with-iconv="-L/usr/local/lib -liconv"'.
97
+ You don't need to specify the header file directory for "iconv.h"
98
+ to the compiler, as it isn't included directly by bind-9 with
101
+ --with-idnlib=IDN_LIBSPEC
102
+ With this option, you can explicitly specify the argument(s)
103
+ to `cc' or `ld' to link the idnkit's library, `libidnkit'. If
104
+ this option is not specified, `-L${PREFIX}/lib -lidnkit' is
105
+ assumed, where ${PREFIX} is the installation prefix specified
106
+ with `--with-idn' option above. You may need to use this
107
+ option to specify extra argments, for example,
108
+ `--with-idnlib="-L/usr/local/lib -R/usr/local/lib -lidnkit"'.
110
+Please consult `README' for other configuration options.
112
+Note that if you want to specify some extra header file directories,
113
+you should use the environment variable STD_CINCLUDES instead of
114
+CFLAGS, as described in README.
116
+2. Compilation and installation
118
+After running "configure", just do
123
+for compiling and installing.
126
+* Contact information
128
+Please see http//www.nic.ad.jp/en/idn/ for the latest news
129
+about idnkit and this patch.
131
+Bug reports and comments on this kit should be sent to
132
+mdnkit-bugs@nic.ad.jp and idn-cmt@nic.ad.jp, respectively.
135
+; $Id: bind-9.2.2-patch,v 1.1.1.1 2003/06/04 00:27:32 marka Exp $
137
===================================================================
138
RCS file: /proj/cvs/prod/bind9/config.h.in,v
139
retrieving revision 1.47.2.3.2.11
140
diff -U2 -r1.47.2.3.2.11 config.h.in
141
--- config.h.in 1 Sep 2004 07:18:30 -0000 1.47.2.3.2.11
142
+++ config.h.in 1 Sep 2004 07:47:48 -0000
146
-/* $Id: config.h.in,v 1.47.2.3.2.11 2004/09/01 07:18:30 marka Exp $ */
147
+/* $Id: acconfig.h,v 1.35.2.4.2.8 2004/05/21 08:24:04 marka Exp $ */
151
#undef HAVE_LINUX_CAPABILITY_H
153
+/* Define to 1 if you have the <locale.h> header file. */
154
+#undef HAVE_LOCALE_H
156
/* Define to 1 if you have the <memory.h> header file. */
159
#undef HAVE_NET_IF6_H
161
+/* Define to 1 if you have the `setlocale' function. */
162
+#undef HAVE_SETLOCALE
164
/* Define to 1 if you have the <stdint.h> header file. */
167
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
168
#undef TIME_WITH_SYS_TIME
170
+/* define if idnkit support is to be included. */
173
/* Define to 1 if your processor stores words with the most significant byte
175
===================================================================
176
RCS file: /proj/cvs/prod/bind9/configure,v
177
retrieving revision 1.284.2.19.2.26
178
diff -U2 -r1.284.2.19.2.26 configure
179
--- configure 1 Sep 2004 07:18:30 -0000 1.284.2.19.2.26
180
+++ configure 1 Sep 2004 07:49:43 -0000
182
# PERFORMANCE OF THIS SOFTWARE.
184
-# $Id: configure,v 1.284.2.19.2.26 2004/09/01 07:18:30 marka Exp $
185
+# $Id: COPYRIGHT,v 1.6.2.2.8.2 2004/03/08 04:04:12 marka Exp $
187
# Portions Copyright (C) 1996-2001 Nominum, Inc.
191
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_HAVELONGLONG ISC_PLATFORM_HAVELIFCONF ISC_PLATFORM_NEEDSYSSELECTH LWRES_PLATFORM_NEEDSYSSELECTH USE_OPENSSL DST_OPENSSL_INC USE_GSSAPI DST_GSSAPI_INC DNS_CRYPTO_LIBS ALWAYS_DEFINES ISC_PLATFORM_USETHREADS ISC_THREAD_DIR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK LIBBIND ISC_PLATFORM_HAVEIPV6 LWRES_PLATFORM_HAVEIPV6 ISC_PLATFORM_NEEDNETINETIN6H LWRES_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H LWRES_PLATFORM_NEEDNETINET6IN6H ISC_PLATFORM_HAVEINADDR6 LWRES_PLATFORM_HAVEINADDR6 ISC_PLATFORM_NEEDIN6ADDRANY LWRES_PLATFORM_NEEDIN6ADDRANY ISC_PLATFORM_NEEDIN6ADDRLOOPBACK LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C LWRES_HAVE_SIN6_SCOPE_ID ISC_PLATFORM_HAVESCOPEID ISC_PLATFORM_HAVEIF_LADDRREQ ISC_PLATFORM_HAVEIF_LADDRCONF ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON ISC_PLATFORM_HAVESALEN LWRES_PLATFORM_HAVESALEN ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_NEEDADDRINFO ISC_LWRES_NEEDRRSETINFO ISC_LWRES_SETHOSTENTINT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_GETNETBYADDRINADDR ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDMEMMOVE ISC_PLATFORM_NEEDSTRTOUL ISC_PLATFORM_NEEDSTRLCPY ISC_PLATFORM_NEEDSTRLCAT ISC_PLATFORM_NEEDSPRINTF LWRES_PLATFORM_NEEDSPRINTF ISC_PLATFORM_NEEDVSNPRINTF LWRES_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS ISC_PLATFORM_QUADFORMAT ISC_PLATFORM_RLIMITTYPE ISC_PLATFORM_USEDECLSPEC LWRES_PLATFORM_USEDECLSPEC ISC_PLATFORM_BRACEPTHREADONCEINIT ISC_PLATFORM_HAVEIFNAMETOINDEX OPENJADE JADETEX PDFJADETEX SGMLCATALOG HTMLSTYLE PRINTSTYLE XMLDCL DOCBOOK2MANSPEC BIND9_TOP_BUILDDIR BIND9_ISC_BUILDINCLUDE BIND9_ISCCC_BUILDINCLUDE BIND9_ISCCFG_BUILDINCLUDE BIND9_DNS_BUILDINCLUDE BIND9_LWRES_BUILDINCLUDE BIND9_BIND9_BUILDINCLUDE BIND9_VERSION LIBOBJS LTLIBOBJS'
192
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_HAVELONGLONG ISC_PLATFORM_HAVELIFCONF ISC_PLATFORM_NEEDSYSSELECTH LWRES_PLATFORM_NEEDSYSSELECTH USE_OPENSSL DST_OPENSSL_INC USE_GSSAPI DST_GSSAPI_INC DNS_CRYPTO_LIBS ALWAYS_DEFINES ISC_PLATFORM_USETHREADS ISC_THREAD_DIR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK LIBBIND ISC_PLATFORM_HAVEIPV6 LWRES_PLATFORM_HAVEIPV6 ISC_PLATFORM_NEEDNETINETIN6H LWRES_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H LWRES_PLATFORM_NEEDNETINET6IN6H ISC_PLATFORM_HAVEINADDR6 LWRES_PLATFORM_HAVEINADDR6 ISC_PLATFORM_NEEDIN6ADDRANY LWRES_PLATFORM_NEEDIN6ADDRANY ISC_PLATFORM_NEEDIN6ADDRLOOPBACK LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C LWRES_HAVE_SIN6_SCOPE_ID ISC_PLATFORM_HAVESCOPEID ISC_PLATFORM_HAVEIF_LADDRREQ ISC_PLATFORM_HAVEIF_LADDRCONF ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON ISC_PLATFORM_HAVESALEN LWRES_PLATFORM_HAVESALEN ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_NEEDADDRINFO ISC_LWRES_NEEDRRSETINFO ISC_LWRES_SETHOSTENTINT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_GETNETBYADDRINADDR ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDMEMMOVE ISC_PLATFORM_NEEDSTRTOUL ISC_PLATFORM_NEEDSTRLCPY ISC_PLATFORM_NEEDSTRLCAT ISC_PLATFORM_NEEDSPRINTF LWRES_PLATFORM_NEEDSPRINTF ISC_PLATFORM_NEEDVSNPRINTF LWRES_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS ISC_PLATFORM_QUADFORMAT ISC_PLATFORM_RLIMITTYPE ISC_PLATFORM_USEDECLSPEC LWRES_PLATFORM_USEDECLSPEC ISC_PLATFORM_BRACEPTHREADONCEINIT ISC_PLATFORM_HAVEIFNAMETOINDEX OPENJADE JADETEX PDFJADETEX SGMLCATALOG HTMLSTYLE PRINTSTYLE XMLDCL DOCBOOK2MANSPEC IDNLIBS BIND9_TOP_BUILDDIR BIND9_ISC_BUILDINCLUDE BIND9_ISCCC_BUILDINCLUDE BIND9_ISCCFG_BUILDINCLUDE BIND9_DNS_BUILDINCLUDE BIND9_LWRES_BUILDINCLUDE BIND9_BIND9_BUILDINCLUDE BIND9_VERSION LIBOBJS LTLIBOBJS'
193
ac_subst_files='BIND9_MAKE_INCLUDES BIND9_MAKE_RULES LIBISC_API LIBISCCC_API LIBISCCFG_API LIBDNS_API LIBBIND9_API LIBLWRES_API'
195
@@ -1081,4 +1081,8 @@
196
include additional configurations [automatic]
197
--with-kame=PATH use Kame IPv6 default path /usr/local/v6
198
+ --with-idn=MPREFIX enable IDN support using idnkit default PREFIX
199
+ --with-libiconv=IPREFIX GNU libiconv are in IPREFIX default PREFIX
200
+ --with-iconv=LIBSPEC specify iconv library default -liconv
201
+ --with-idnlib=ARG specify libidnkit
203
Some influential environment variables:
204
@@ -7921,5 +7925,5 @@
206
# Find out which ABI we are using.
207
- echo '#line 7923 "configure"' > conftest.$ac_ext
208
+ echo '#line 7927 "configure"' > conftest.$ac_ext
209
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
210
(eval $ac_compile) 2>&5
211
@@ -8911,5 +8915,5 @@
213
# Provide some information about the compiler.
214
-echo "$as_me:8913:" \
215
+echo "$as_me:8917:" \
216
"checking for Fortran 77 compiler version" >&5
217
ac_compiler=`set X $ac_compile; echo $2`
218
@@ -9949,9 +9953,9 @@
219
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
220
-e 's:$: $lt_compiler_flag:'`
221
- (eval echo "\"\$as_me:9951: $lt_compile\"" >&5)
222
+ (eval echo "\"\$as_me:9955: $lt_compile\"" >&5)
223
(eval "$lt_compile" 2>conftest.err)
226
- echo "$as_me:9955: \$? = $ac_status" >&5
227
+ echo "$as_me:9959: \$? = $ac_status" >&5
228
if (exit $ac_status) && test -s "$ac_outfile"; then
229
# The compiler can only warn and ignore the option if not recognized
230
@@ -10182,9 +10186,9 @@
231
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
232
-e 's:$: $lt_compiler_flag:'`
233
- (eval echo "\"\$as_me:10184: $lt_compile\"" >&5)
234
+ (eval echo "\"\$as_me:10188: $lt_compile\"" >&5)
235
(eval "$lt_compile" 2>conftest.err)
238
- echo "$as_me:10188: \$? = $ac_status" >&5
239
+ echo "$as_me:10192: \$? = $ac_status" >&5
240
if (exit $ac_status) && test -s "$ac_outfile"; then
241
# The compiler can only warn and ignore the option if not recognized
242
@@ -10242,9 +10246,9 @@
243
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
244
-e 's:$: $lt_compiler_flag:'`
245
- (eval echo "\"\$as_me:10244: $lt_compile\"" >&5)
246
+ (eval echo "\"\$as_me:10248: $lt_compile\"" >&5)
247
(eval "$lt_compile" 2>out/conftest.err)
249
cat out/conftest.err >&5
250
- echo "$as_me:10248: \$? = $ac_status" >&5
251
+ echo "$as_me:10252: \$? = $ac_status" >&5
252
if (exit $ac_status) && test -s out/conftest2.$ac_objext
254
@@ -12426,5 +12430,5 @@
255
lt_status=$lt_dlunknown
256
cat > conftest.$ac_ext <<EOF
257
-#line 12428 "configure"
258
+#line 12432 "configure"
259
#include "confdefs.h"
261
@@ -12524,5 +12528,5 @@
262
lt_status=$lt_dlunknown
263
cat > conftest.$ac_ext <<EOF
264
-#line 12526 "configure"
265
+#line 12530 "configure"
266
#include "confdefs.h"
268
@@ -14707,9 +14711,9 @@
269
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
270
-e 's:$: $lt_compiler_flag:'`
271
- (eval echo "\"\$as_me:14709: $lt_compile\"" >&5)
272
+ (eval echo "\"\$as_me:14713: $lt_compile\"" >&5)
273
(eval "$lt_compile" 2>conftest.err)
276
- echo "$as_me:14713: \$? = $ac_status" >&5
277
+ echo "$as_me:14717: \$? = $ac_status" >&5
278
if (exit $ac_status) && test -s "$ac_outfile"; then
279
# The compiler can only warn and ignore the option if not recognized
280
@@ -14767,9 +14771,9 @@
281
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
282
-e 's:$: $lt_compiler_flag:'`
283
- (eval echo "\"\$as_me:14769: $lt_compile\"" >&5)
284
+ (eval echo "\"\$as_me:14773: $lt_compile\"" >&5)
285
(eval "$lt_compile" 2>out/conftest.err)
287
cat out/conftest.err >&5
288
- echo "$as_me:14773: \$? = $ac_status" >&5
289
+ echo "$as_me:14777: \$? = $ac_status" >&5
290
if (exit $ac_status) && test -s out/conftest2.$ac_objext
292
@@ -16128,5 +16132,5 @@
293
lt_status=$lt_dlunknown
294
cat > conftest.$ac_ext <<EOF
295
-#line 16130 "configure"
296
+#line 16134 "configure"
297
#include "confdefs.h"
299
@@ -16226,5 +16230,5 @@
300
lt_status=$lt_dlunknown
301
cat > conftest.$ac_ext <<EOF
302
-#line 16228 "configure"
303
+#line 16232 "configure"
304
#include "confdefs.h"
306
@@ -17053,9 +17057,9 @@
307
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
308
-e 's:$: $lt_compiler_flag:'`
309
- (eval echo "\"\$as_me:17055: $lt_compile\"" >&5)
310
+ (eval echo "\"\$as_me:17059: $lt_compile\"" >&5)
311
(eval "$lt_compile" 2>conftest.err)
314
- echo "$as_me:17059: \$? = $ac_status" >&5
315
+ echo "$as_me:17063: \$? = $ac_status" >&5
316
if (exit $ac_status) && test -s "$ac_outfile"; then
317
# The compiler can only warn and ignore the option if not recognized
318
@@ -17113,9 +17117,9 @@
319
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
320
-e 's:$: $lt_compiler_flag:'`
321
- (eval echo "\"\$as_me:17115: $lt_compile\"" >&5)
322
+ (eval echo "\"\$as_me:17119: $lt_compile\"" >&5)
323
(eval "$lt_compile" 2>out/conftest.err)
325
cat out/conftest.err >&5
326
- echo "$as_me:17119: \$? = $ac_status" >&5
327
+ echo "$as_me:17123: \$? = $ac_status" >&5
328
if (exit $ac_status) && test -s out/conftest2.$ac_objext
330
@@ -19151,9 +19155,9 @@
331
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
332
-e 's:$: $lt_compiler_flag:'`
333
- (eval echo "\"\$as_me:19153: $lt_compile\"" >&5)
334
+ (eval echo "\"\$as_me:19157: $lt_compile\"" >&5)
335
(eval "$lt_compile" 2>conftest.err)
338
- echo "$as_me:19157: \$? = $ac_status" >&5
339
+ echo "$as_me:19161: \$? = $ac_status" >&5
340
if (exit $ac_status) && test -s "$ac_outfile"; then
341
# The compiler can only warn and ignore the option if not recognized
342
@@ -19384,9 +19388,9 @@
343
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
344
-e 's:$: $lt_compiler_flag:'`
345
- (eval echo "\"\$as_me:19386: $lt_compile\"" >&5)
346
+ (eval echo "\"\$as_me:19390: $lt_compile\"" >&5)
347
(eval "$lt_compile" 2>conftest.err)
350
- echo "$as_me:19390: \$? = $ac_status" >&5
351
+ echo "$as_me:19394: \$? = $ac_status" >&5
352
if (exit $ac_status) && test -s "$ac_outfile"; then
353
# The compiler can only warn and ignore the option if not recognized
354
@@ -19444,9 +19448,9 @@
355
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
356
-e 's:$: $lt_compiler_flag:'`
357
- (eval echo "\"\$as_me:19446: $lt_compile\"" >&5)
358
+ (eval echo "\"\$as_me:19450: $lt_compile\"" >&5)
359
(eval "$lt_compile" 2>out/conftest.err)
361
cat out/conftest.err >&5
362
- echo "$as_me:19450: \$? = $ac_status" >&5
363
+ echo "$as_me:19454: \$? = $ac_status" >&5
364
if (exit $ac_status) && test -s out/conftest2.$ac_objext
366
@@ -21628,5 +21632,5 @@
367
lt_status=$lt_dlunknown
368
cat > conftest.$ac_ext <<EOF
369
-#line 21630 "configure"
370
+#line 21634 "configure"
371
#include "confdefs.h"
373
@@ -21726,5 +21730,5 @@
374
lt_status=$lt_dlunknown
375
cat > conftest.$ac_ext <<EOF
376
-#line 21728 "configure"
377
+#line 21732 "configure"
378
#include "confdefs.h"
380
@@ -27310,4 +27314,354 @@
386
+# Check whether --with-idn or --without-idn was given.
387
+if test "${with_idn+set}" = set; then
388
+ withval="$with_idn"
395
+ if test X$prefix = XNONE ; then
396
+ idn_path=/usr/local
404
+ idn_path="$use_idn"
411
+# Check whether --with-libiconv or --without-libiconv was given.
412
+if test "${with_libiconv+set}" = set; then
413
+ withval="$with_libiconv"
414
+ use_libiconv="$withval"
418
+case "$use_libiconv" in
420
+ if test X$prefix = XNONE ; then
421
+ iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
423
+ iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
430
+ iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
435
+# Check whether --with-iconv or --without-iconv was given.
436
+if test "${with_iconv+set}" = set; then
437
+ withval="$with_iconv"
438
+ iconvlib="$withval"
450
+# Check whether --with-idnlib or --without-idnlib was given.
451
+if test "${with_idnlib+set}" = set; then
452
+ withval="$with_idnlib"
457
+if test "$idnlib" = yes; then
458
+ { { echo "$as_me:$LINENO: error: You must specify ARG for --with-idnlib." >&5
459
+echo "$as_me: error: You must specify ARG for --with-idnlib." >&2;}
460
+ { (exit 1); exit 1; }; }
464
+if test "$use_idn" != no; then
466
+cat >>confdefs.h <<\_ACEOF
470
+ STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
471
+ if test "$idnlib" != no; then
472
+ IDNLIBS="$idnlib $iconvlib"
474
+ IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
480
+for ac_header in locale.h
482
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
483
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
484
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
485
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
486
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
487
+ echo $ECHO_N "(cached) $ECHO_C" >&6
489
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
490
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
492
+ # Is the header compilable?
493
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
494
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
495
+cat >conftest.$ac_ext <<_ACEOF
498
+cat confdefs.h >>conftest.$ac_ext
499
+cat >>conftest.$ac_ext <<_ACEOF
500
+/* end confdefs.h. */
501
+$ac_includes_default
502
+#include <$ac_header>
504
+rm -f conftest.$ac_objext
505
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
506
+ (eval $ac_compile) 2>conftest.er1
508
+ grep -v '^ *+' conftest.er1 >conftest.err
510
+ cat conftest.err >&5
511
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
512
+ (exit $ac_status); } &&
513
+ { ac_try='test -z "$ac_c_werror_flag"
514
+ || test ! -s conftest.err'
515
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
516
+ (eval $ac_try) 2>&5
518
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
519
+ (exit $ac_status); }; } &&
520
+ { ac_try='test -s conftest.$ac_objext'
521
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
522
+ (eval $ac_try) 2>&5
524
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
525
+ (exit $ac_status); }; }; then
526
+ ac_header_compiler=yes
528
+ echo "$as_me: failed program was:" >&5
529
+sed 's/^/| /' conftest.$ac_ext >&5
531
+ac_header_compiler=no
533
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
534
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
535
+echo "${ECHO_T}$ac_header_compiler" >&6
537
+# Is the header present?
538
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
539
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
540
+cat >conftest.$ac_ext <<_ACEOF
543
+cat confdefs.h >>conftest.$ac_ext
544
+cat >>conftest.$ac_ext <<_ACEOF
545
+/* end confdefs.h. */
546
+#include <$ac_header>
548
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
549
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
551
+ grep -v '^ *+' conftest.er1 >conftest.err
553
+ cat conftest.err >&5
554
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
555
+ (exit $ac_status); } >/dev/null; then
556
+ if test -s conftest.err; then
557
+ ac_cpp_err=$ac_c_preproc_warn_flag
558
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
565
+if test -z "$ac_cpp_err"; then
566
+ ac_header_preproc=yes
568
+ echo "$as_me: failed program was:" >&5
569
+sed 's/^/| /' conftest.$ac_ext >&5
571
+ ac_header_preproc=no
573
+rm -f conftest.err conftest.$ac_ext
574
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
575
+echo "${ECHO_T}$ac_header_preproc" >&6
577
+# So? What about this header?
578
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
580
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
581
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
582
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
583
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
584
+ ac_header_preproc=yes
587
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
588
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
589
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
590
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
591
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
592
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
593
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
594
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
595
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
596
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
597
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
598
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
601
+## ------------------------------------------ ##
602
+## Report this to the AC_PACKAGE_NAME lists. ##
603
+## ------------------------------------------ ##
606
+ sed "s/^/$as_me: WARNING: /" >&2
609
+echo "$as_me:$LINENO: checking for $ac_header" >&5
610
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
611
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
612
+ echo $ECHO_N "(cached) $ECHO_C" >&6
614
+ eval "$as_ac_Header=\$ac_header_preproc"
616
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
617
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
620
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
621
+ cat >>confdefs.h <<_ACEOF
622
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
630
+for ac_func in setlocale
632
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
633
+echo "$as_me:$LINENO: checking for $ac_func" >&5
634
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
635
+if eval "test \"\${$as_ac_var+set}\" = set"; then
636
+ echo $ECHO_N "(cached) $ECHO_C" >&6
638
+ cat >conftest.$ac_ext <<_ACEOF
641
+cat confdefs.h >>conftest.$ac_ext
642
+cat >>conftest.$ac_ext <<_ACEOF
643
+/* end confdefs.h. */
644
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
645
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
646
+#define $ac_func innocuous_$ac_func
648
+/* System header to define __stub macros and hopefully few prototypes,
649
+ which can conflict with char $ac_func (); below.
650
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
651
+ <limits.h> exists even on freestanding compilers. */
654
+# include <limits.h>
656
+# include <assert.h>
661
+/* Override any gcc2 internal prototype to avoid an error. */
666
+/* We use char because int might match the return type of a gcc2
667
+ builtin and then its argument prototype would still apply. */
669
+/* The GNU C library defines this for functions which it implements
670
+ to always fail with ENOSYS. Some functions are actually named
671
+ something starting with __ and the normal name is an alias. */
672
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
675
+char (*f) () = $ac_func;
684
+return f != $ac_func;
689
+rm -f conftest.$ac_objext conftest$ac_exeext
690
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
691
+ (eval $ac_link) 2>conftest.er1
693
+ grep -v '^ *+' conftest.er1 >conftest.err
695
+ cat conftest.err >&5
696
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
697
+ (exit $ac_status); } &&
698
+ { ac_try='test -z "$ac_c_werror_flag"
699
+ || test ! -s conftest.err'
700
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
701
+ (eval $ac_try) 2>&5
703
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
704
+ (exit $ac_status); }; } &&
705
+ { ac_try='test -s conftest$ac_exeext'
706
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
707
+ (eval $ac_try) 2>&5
709
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
710
+ (exit $ac_status); }; }; then
711
+ eval "$as_ac_var=yes"
713
+ echo "$as_me: failed program was:" >&5
714
+sed 's/^/| /' conftest.$ac_ext >&5
716
+eval "$as_ac_var=no"
718
+rm -f conftest.err conftest.$ac_objext \
719
+ conftest$ac_exeext conftest.$ac_ext
721
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
722
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
723
+if test `eval echo '${'$as_ac_var'}'` = yes; then
724
+ cat >>confdefs.h <<_ACEOF
725
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
735
@@ -28192,4 +28546,5 @@
736
s,@XMLDCL@,$XMLDCL,;t t
737
s,@DOCBOOK2MANSPEC@,$DOCBOOK2MANSPEC,;t t
738
+s,@IDNLIBS@,$IDNLIBS,;t t
739
s,@BIND9_TOP_BUILDDIR@,$BIND9_TOP_BUILDDIR,;t t
740
s,@BIND9_ISC_BUILDINCLUDE@,$BIND9_ISC_BUILDINCLUDE,;t t
742
===================================================================
743
RCS file: /proj/cvs/prod/bind9/configure.in,v
744
retrieving revision 1.294.2.23.2.30
745
diff -U2 -r1.294.2.23.2.30 configure.in
746
--- configure.in 1 Sep 2004 07:16:34 -0000 1.294.2.23.2.30
747
+++ configure.in 1 Sep 2004 07:49:51 -0000
748
@@ -2038,4 +2038,80 @@
754
+ [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
755
+ use_idn="$withval", use_idn="no")
758
+ if test X$prefix = XNONE ; then
759
+ idn_path=/usr/local
767
+ idn_path="$use_idn"
773
+AC_ARG_WITH(libiconv,
774
+ [ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
775
+ use_libiconv="$withval", use_libiconv="no")
776
+case "$use_libiconv" in
778
+ if test X$prefix = XNONE ; then
779
+ iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
781
+ iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
788
+ iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
793
+ [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
794
+ iconvlib="$withval")
805
+ [ --with-idnlib=ARG specify libidnkit],
806
+ idnlib="$withval", idnlib="no")
807
+if test "$idnlib" = yes; then
808
+ AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
812
+if test "$use_idn" != no; then
813
+ AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
814
+ STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
815
+ if test "$idnlib" != no; then
816
+ IDNLIBS="$idnlib $iconvlib"
818
+ IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
823
+AC_CHECK_HEADERS(locale.h)
824
+AC_CHECK_FUNCS(setlocale)
829
Index: bin/dig/Makefile.in
830
===================================================================
831
RCS file: /proj/cvs/prod/bind9/bin/dig/Makefile.in,v
832
retrieving revision 1.25.12.12
833
diff -U2 -r1.25.12.12 Makefile.in
834
--- bin/dig/Makefile.in 18 Aug 2004 23:25:57 -0000 1.25.12.12
835
+++ bin/dig/Makefile.in 1 Sep 2004 07:49:52 -0000
838
LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} ${ISCLIBS} \
839
- ${ISCCFGLIBS} @LIBS@
840
+ ${ISCCFGLIBS} @IDNLIBS@ @LIBS@
844
===================================================================
845
RCS file: /proj/cvs/prod/bind9/bin/dig/dig.1,v
846
retrieving revision 1.14.2.4.2.6
847
diff -U2 -r1.14.2.4.2.6 dig.1
848
--- bin/dig/dig.1 23 Jun 2004 09:11:01 -0000 1.14.2.4.2.6
849
+++ bin/dig/dig.1 1 Sep 2004 07:49:54 -0000
851
will not print the initial query when it looks up the NS records for
855
+If \fBdig\fR has been built with IDN (internationalized
856
+domain name) support, it can accept and display non-ASCII domain names.
857
+\fBdig\fR appropriately converts character encoding of
858
+domain name before sending a request to DNS server or displaying a
859
+reply from the server.
860
+If you'd like to turn off the IDN support for some reason, defines
861
+the \fBIDN_DISABLE\fR environment variable.
862
+The IDN support is disabled if the the variable is set when
866
Index: bin/dig/dig.docbook
867
===================================================================
868
RCS file: /proj/cvs/prod/bind9/bin/dig/dig.docbook,v
869
retrieving revision 1.4.2.7.4.9
870
diff -U2 -r1.4.2.7.4.9 dig.docbook
871
--- bin/dig/dig.docbook 23 Jun 2004 04:19:41 -0000 1.4.2.7.4.9
872
+++ bin/dig/dig.docbook 1 Sep 2004 07:49:57 -0000
876
+<title>IDN SUPPORT</title>
878
+If <command>dig</command> has been built with IDN (internationalized
879
+domain name) support, it can accept and display non-ASCII domain names.
880
+<command>dig</command> appropriately converts character encoding of
881
+domain name before sending a request to DNS server or displaying a
882
+reply from the server.
883
+If you'd like to turn off the IDN support for some reason, defines
884
+the <envar>IDN_DISABLE</envar> environment variable.
885
+The IDN support is disabled if the the variable is set when
886
+<command>dig</command> runs.
893
Index: bin/dig/dighost.c
894
===================================================================
895
RCS file: /proj/cvs/prod/bind9/bin/dig/dighost.c,v
896
retrieving revision 1.221.2.19.2.14
897
diff -U2 -r1.221.2.19.2.14 dighost.c
898
--- bin/dig/dighost.c 30 Jun 2004 23:57:52 -0000 1.221.2.19.2.14
899
+++ bin/dig/dighost.c 1 Sep 2004 07:50:24 -0000
903
+#ifdef HAVE_LOCALE_H
908
+#include <idn/result.h>
909
+#include <idn/log.h>
910
+#include <idn/resconf.h>
911
+#include <idn/api.h>
914
#include <dns/byaddr.h>
917
int lookup_counter = 0;
920
+static void initialize_idn(void);
921
+static isc_result_t output_filter(isc_buffer_t *buffer,
922
+ unsigned int used_org,
923
+ isc_boolean_t absolute);
924
+static idn_result_t append_textname(char *name, const char *origin,
926
+static void idn_check_result(idn_result_t r, const char *msg);
934
copy_server_list(lwconf, &server_list);
942
@@ -1568,4 +1595,12 @@
947
+ char utf8_textname[MXNAME], utf8_origin[MXNAME], idn_textname[MXNAME];
951
+ dns_name_settotextfilter(output_filter);
954
REQUIRE(lookup != NULL);
955
@@ -1596,4 +1631,15 @@
956
sizeof(lookup->onamespace));
960
+ * We cannot convert `textname' and `origin' separately.
961
+ * `textname' doesn't contain TLD, but local mapping needs
964
+ mr = idn_encodename(IDN_LOCALCONV | IDN_DELIMMAP, lookup->textname,
965
+ utf8_textname, sizeof(utf8_textname));
966
+ idn_check_result(mr, "convert textname to UTF-8");
970
* If the name has too many dots, force the origin to be NULL
971
@@ -1604,4 +1650,11 @@
973
/* XXX New search here? */
975
+ if ((count_dots(utf8_textname) >= ndots) || !usesearch)
976
+ lookup->origin = NULL; /* Force abs lookup */
977
+ else if (lookup->origin == NULL && lookup->new_search && usesearch) {
978
+ lookup->origin = ISC_LIST_HEAD(search_list);
981
if ((count_dots(lookup->textname) >= ndots) || !usesearch)
982
lookup->origin = NULL; /* Force abs lookup */
983
@@ -1609,5 +1662,27 @@
984
lookup->origin = ISC_LIST_HEAD(search_list);
989
+ if (lookup->origin != NULL) {
990
+ mr = idn_encodename(IDN_LOCALCONV | IDN_DELIMMAP,
991
+ lookup->origin->origin, utf8_origin,
992
+ sizeof(utf8_origin));
993
+ idn_check_result(mr, "convert origin to UTF-8");
994
+ mr = append_textname(utf8_textname, utf8_origin,
995
+ sizeof(utf8_textname));
996
+ idn_check_result(mr, "append origin to textname");
998
+ mr = idn_encodename(IDN_LOCALMAP | IDN_NAMEPREP | IDN_ASCCHECK |
999
+ IDN_IDNCONV | IDN_LENCHECK, utf8_textname,
1000
+ idn_textname, sizeof(idn_textname));
1001
+ idn_check_result(mr, "convert UTF-8 textname to IDN encoding");
1007
if (lookup->origin != NULL) {
1009
debug("trying origin %s", lookup->origin->origin);
1010
result = dns_message_gettempname(lookup->sendmsg,
1011
@@ -1654,4 +1729,13 @@
1012
dns_name_clone(dns_rootname, lookup->name);
1015
+ len = strlen(idn_textname);
1016
+ isc_buffer_init(&b, idn_textname, len);
1017
+ isc_buffer_add(&b, len);
1018
+ result = dns_name_fromtext(lookup->name, &b,
1021
+ &lookup->namebuf);
1023
len = strlen(lookup->textname);
1024
isc_buffer_init(&b, lookup->textname, len);
1025
@@ -1661,4 +1745,5 @@
1030
if (result != ISC_R_SUCCESS) {
1031
@@ -3165,4 +3250,102 @@
1032
isc_mem_destroy(&mctx);
1037
+initialize_idn(void) {
1040
+#ifdef HAVE_SETLOCALE
1042
+ (void)setlocale(LC_ALL, "");
1044
+ /* Create configuration context. */
1045
+ r = idn_nameinit(1);
1046
+ if (r != idn_success)
1047
+ fatal("idn api initialization failed: %s",
1048
+ idn_result_tostring(r));
1050
+ /* Set domain name -> text post-conversion filter. */
1051
+ dns_name_settotextfilter(output_filter);
1054
+static isc_result_t
1055
+output_filter(isc_buffer_t *buffer, unsigned int used_org,
1056
+ isc_boolean_t absolute)
1058
+ char tmp1[MAXDLEN], tmp2[MAXDLEN];
1059
+ size_t fromlen, tolen;
1060
+ isc_boolean_t end_with_dot;
1063
+ * Copy contents of 'buffer' to 'tmp1', supply trailing dot
1064
+ * if 'absolute' is true, and terminate with NUL.
1066
+ fromlen = isc_buffer_usedlength(buffer) - used_org;
1067
+ if (fromlen >= MAXDLEN)
1068
+ return (ISC_R_SUCCESS);
1069
+ memcpy(tmp1, (char *)isc_buffer_base(buffer) + used_org, fromlen);
1070
+ end_with_dot = (tmp1[fromlen - 1] == '.') ? ISC_TRUE : ISC_FALSE;
1071
+ if (absolute && !end_with_dot) {
1073
+ if (fromlen >= MAXDLEN)
1074
+ return (ISC_R_SUCCESS);
1075
+ tmp1[fromlen - 1] = '.';
1077
+ tmp1[fromlen] = '\0';
1080
+ * Convert contents of 'tmp1' to local encoding.
1082
+ if (idn_decodename(IDN_DECODE_APP, tmp1, tmp2, MAXDLEN) != idn_success)
1083
+ return (ISC_R_SUCCESS);
1084
+ strcpy(tmp1, tmp2);
1087
+ * Copy the converted contents in 'tmp1' back to 'buffer'.
1088
+ * If we have appended trailing dot, remove it.
1090
+ tolen = strlen(tmp1);
1091
+ if (absolute && !end_with_dot && tmp1[tolen - 1] == '.')
1094
+ if (isc_buffer_length(buffer) < used_org + tolen)
1095
+ return (ISC_R_NOSPACE);
1097
+ isc_buffer_subtract(buffer, isc_buffer_usedlength(buffer) - used_org);
1098
+ memcpy(isc_buffer_used(buffer), tmp1, tolen);
1099
+ isc_buffer_add(buffer, tolen);
1101
+ return (ISC_R_SUCCESS);
1104
+static idn_result_t
1105
+append_textname(char *name, const char *origin, size_t namesize) {
1106
+ size_t namelen = strlen(name);
1107
+ size_t originlen = strlen(origin);
1109
+ /* Already absolute? */
1110
+ if (namelen > 0 && name[namelen - 1] == '.')
1111
+ return idn_success;
1113
+ /* Append dot and origin */
1115
+ if (namelen + 1 + originlen >= namesize)
1116
+ return idn_buffer_overflow;
1118
+ name[namelen++] = '.';
1119
+ (void)strcpy(name + namelen, origin);
1120
+ return idn_success;
1124
+idn_check_result(idn_result_t r, const char *msg) {
1125
+ if (r != idn_success) {
1127
+ fatal("%s: %s", msg, idn_result_tostring(r));
1131
+#endif /* WITH_IDN */
1134
Index: bin/dig/host.1
1135
===================================================================
1136
RCS file: /proj/cvs/prod/bind9/bin/dig/host.1,v
1137
retrieving revision 1.11.2.1.4.4
1138
diff -U2 -r1.11.2.1.4.4 host.1
1139
--- bin/dig/host.1 13 Apr 2004 04:11:03 -0000 1.11.2.1.4.4
1140
+++ bin/dig/host.1 1 Sep 2004 07:50:24 -0000
1141
@@ -128,4 +128,15 @@
1142
will be set to the number of seconds given by the hardware's maximum
1143
value for an integer quantity.
1146
+If \fBhost\fR has been built with IDN (internationalized
1147
+domain name) support, it can accept and display non-ASCII domain names.
1148
+\fBhost\fR appropriately converts character encoding of
1149
+domain name before sending a request to DNS server or displaying a
1150
+reply from the server.
1151
+If you'd like to turn off the IDN support for some reason, defines
1152
+the \fBIDN_DISABLE\fR environment variable.
1153
+The IDN support is disabled if the the variable is set when
1157
Index: bin/dig/host.docbook
1158
===================================================================
1159
RCS file: /proj/cvs/prod/bind9/bin/dig/host.docbook,v
1160
retrieving revision 1.2.2.2.4.5
1161
diff -U2 -r1.2.2.2.4.5 host.docbook
1162
--- bin/dig/host.docbook 13 Apr 2004 01:26:26 -0000 1.2.2.2.4.5
1163
+++ bin/dig/host.docbook 1 Sep 2004 07:50:27 -0000
1164
@@ -192,4 +192,19 @@
1167
+<title>IDN SUPPORT</title>
1169
+If <command>host</command> has been built with IDN (internationalized
1170
+domain name) support, it can accept and display non-ASCII domain names.
1171
+<command>host</command> appropriately converts character encoding of
1172
+domain name before sending a request to DNS server or displaying a
1173
+reply from the server.
1174
+If you'd like to turn off the IDN support for some reason, defines
1175
+the <envar>IDN_DISABLE</envar> environment variable.
1176
+The IDN support is disabled if the the variable is set when
1177
+<command>host</command> runs.
1182
<title>FILES</title>
1184
Index: lib/dns/name.c
1185
===================================================================
1186
RCS file: /proj/cvs/prod/bind9/lib/dns/name.c,v
1187
retrieving revision 1.127.2.7.2.11
1188
diff -U2 -r1.127.2.7.2.11 name.c
1189
--- lib/dns/name.c 1 Sep 2004 05:19:59 -0000 1.127.2.7.2.11
1190
+++ lib/dns/name.c 1 Sep 2004 07:50:35 -0000
1191
@@ -183,4 +183,11 @@
1192
dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive);
1196
+ * dns_name_t to text post-conversion procedure.
1198
+static dns_name_totextfilter_t totext_filter_proc = NULL;
1202
set_offsets(const dns_name_t *name, unsigned char *offsets,
1203
@@ -1208,4 +1215,7 @@
1204
unsigned int labels;
1205
isc_boolean_t saw_root = ISC_FALSE;
1207
+ unsigned int oused = target->used;
1211
@@ -1346,4 +1356,9 @@
1212
isc_buffer_add(target, tlen - trem);
1215
+ if (totext_filter_proc != NULL)
1216
+ return ((*totext_filter_proc)(target, oused, saw_root));
1219
return (ISC_R_SUCCESS);
1221
@@ -2201,2 +2216,8 @@
1226
+dns_name_settotextfilter(dns_name_totextfilter_t proc) {
1227
+ totext_filter_proc = proc;
1230
Index: lib/dns/include/dns/name.h
1231
===================================================================
1232
RCS file: /proj/cvs/prod/bind9/lib/dns/include/dns/name.h,v
1233
retrieving revision 1.95.2.3.2.11
1234
diff -U2 -r1.95.2.3.2.11 name.h
1235
--- lib/dns/include/dns/name.h 1 Sep 2004 05:19:59 -0000 1.95.2.3.2.11
1236
+++ lib/dns/include/dns/name.h 1 Sep 2004 07:50:41 -0000
1237
@@ -156,4 +156,15 @@
1238
#define DNS_NAME_MAXWIRE 255
1242
+ * Text output filter procedure.
1243
+ * 'target' is the buffer to be converted. The region to be converted
1244
+ * is from 'buffer'->base + 'used_org' to the end of the used region.
1246
+typedef isc_result_t (*dns_name_totextfilter_t)(isc_buffer_t *target,
1247
+ unsigned int used_org,
1248
+ isc_boolean_t absolute);
1253
@@ -1115,4 +1126,12 @@
1259
+dns_name_settotextfilter(dns_name_totextfilter_t proc);
1261
+ * Call 'proc' at the end of dns_name_totext.
1263
+#endif /* WITH_IDN */
1265
#define DNS_NAME_FORMATSIZE (DNS_NAME_MAXTEXT + 1)