]> git.pld-linux.org Git - packages/bind.git/blame - bind-idn.patch
- patch to kill -linet6 in bind 9.3.0, its unnecessary
[packages/bind.git] / bind-idn.patch
CommitLineData
5c962666
AM
1diff -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
4@@ -353,6 +353,17 @@
5 \fI+noqr\fR which means that \fBdig\fR
6 will not print the initial query when it looks up the NS records for
7 isc.org.
8+.SH "IDN SUPPORT"
9+.PP
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
18+\fBdig\fR runs.
19 .SH "FILES"
20 .PP
21 \fI/etc/resolv.conf\fR
22diff -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
25@@ -529,6 +529,21 @@
26 </refsect1>
27
28 <refsect1>
29+<title>IDN SUPPORT</title>
30+<para>
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.
40+</para>
41+</refsect1>
42+
43+<refsect1>
44 <title>FILES</title>
45 <para>
46 <filename>/etc/resolv.conf</filename>
47diff -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
50@@ -32,6 +32,17 @@
51 #include <string.h>
52 #include <limits.h>
53
54+#ifdef HAVE_LOCALE_H
55+#include <locale.h>
56+#endif
57+
58+#ifdef WITH_IDN
59+#include <idn/result.h>
60+#include <idn/log.h>
61+#include <idn/resconf.h>
62+#include <idn/api.h>
63+#endif
64+
65 #include <dns/byaddr.h>
66 #include <dns/fixedname.h>
67 #include <dns/message.h>
68@@ -131,6 +142,18 @@
69 isc_mutex_t lookup_lock;
70 dig_lookup_t *current_lookup = NULL;
71
72+#ifdef WITH_IDN
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,
78+ size_t namesize);
79+static void idn_check_result(idn_result_t r, const char *msg);
80+
81+#define MAXDLEN 256
82+#endif
83+
84 /*
85 * Apply and clear locks at the event level in global task.
86 * Can I get rid of these using shutdown events? XXX
87@@ -682,6 +705,10 @@
88 ISC_LIST_APPEND(server_list, srv, link);
89 }
90
91+#ifdef WITH_IDN
92+ initialize_idn();
93+#endif
94+
95 if (keyfile[0] != 0)
96 setup_file_key();
97 else if (keysecret[0] != 0)
98@@ -1202,6 +1229,14 @@
99 isc_buffer_t b;
100 dns_compress_t cctx;
101 char store[MXNAME];
102+#ifdef WITH_IDN
103+ idn_result_t mr;
104+ char utf8_textname[MXNAME], utf8_origin[MXNAME], idn_textname[MXNAME];
105+#endif
106+
107+#ifdef WITH_IDN
108+ dns_name_settotextfilter(output_filter);
109+#endif
110
111 REQUIRE(lookup != NULL);
112 INSIST(!free_now);
113@@ -1230,6 +1265,17 @@
114 isc_buffer_init(&lookup->onamebuf, lookup->onamespace,
115 sizeof(lookup->onamespace));
116
117+#ifdef WITH_IDN
118+ /*
119+ * We cannot convert `textname' and `origin' separately.
120+ * `textname' doesn't contain TLD, but local mapping needs
121+ * TLD.
122+ */
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");
126+#endif
127+
128 /*
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.
133 */
134 /* XXX New search here? */
135+#ifdef WITH_IDN
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);
140+ }
141+#else
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);
146 }
147+#endif
148+
149+#ifdef WITH_IDN
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");
158+ }
a35feb65 159+ mr = idn_encodename(IDN_LOCALMAP | IDN_NAMEPREP |
5c962666
AM
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");
163+#endif
164+
165+#ifdef WITH_IDN
166+ if (0) {
167+#else
168+ if (lookup->origin != NULL) {
169+#endif
170 debug("trying origin %s", lookup->origin->origin);
171 result = dns_message_gettempname(lookup->sendmsg,
172 &lookup->oname);
173@@ -1288,6 +1363,15 @@
174 if (lookup->trace && lookup->trace_root)
175 dns_name_clone(dns_rootname, lookup->name);
176 else {
177+#ifdef WITH_IDN
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,
182+ dns_rootname,
183+ ISC_FALSE,
184+ &lookup->namebuf);
185+#else
186 len = strlen(lookup->textname);
187 isc_buffer_init(&b, lookup->textname, len);
188 isc_buffer_add(&b, len);
189@@ -1295,6 +1379,7 @@
190 dns_rootname,
191 ISC_FALSE,
192 &lookup->namebuf);
193+#endif
194 }
195 if (result != ISC_R_SUCCESS) {
196 dns_message_puttempname(lookup->sendmsg,
197@@ -2723,3 +2808,101 @@
198 if (mctx != NULL)
199 isc_mem_destroy(&mctx);
200 }
201+
202+#ifdef WITH_IDN
203+static void
204+initialize_idn(void) {
205+ idn_result_t r;
206+
207+#ifdef HAVE_SETLOCALE
208+ /* Set locale */
209+ (void)setlocale(LC_ALL, "");
210+#endif
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));
216+
217+ /* Set domain name -> text post-conversion filter. */
218+ dns_name_settotextfilter(output_filter);
219+}
220+
221+static isc_result_t
222+output_filter(isc_buffer_t *buffer, unsigned int used_org,
223+ isc_boolean_t absolute)
224+{
225+ char tmp1[MAXDLEN], tmp2[MAXDLEN];
226+ size_t fromlen, tolen;
227+ isc_boolean_t end_with_dot;
228+
229+ /*
230+ * Copy contents of 'buffer' to 'tmp1', supply trailing dot
231+ * if 'absolute' is true, and terminate with NUL.
232+ */
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) {
239+ fromlen++;
240+ if (fromlen >= MAXDLEN)
241+ return (ISC_R_SUCCESS);
242+ tmp1[fromlen - 1] = '.';
243+ }
244+ tmp1[fromlen] = '\0';
245+
246+ /*
247+ * Convert contents of 'tmp1' to local encoding.
248+ */
249+ if (idn_decodename(IDN_DECODE_APP, tmp1, tmp2, MAXDLEN) != idn_success)
250+ return (ISC_R_SUCCESS);
251+ strcpy(tmp1, tmp2);
252+
253+ /*
254+ * Copy the converted contents in 'tmp1' back to 'buffer'.
255+ * If we have appended trailing dot, remove it.
256+ */
257+ tolen = strlen(tmp1);
258+ if (absolute && !end_with_dot && tmp1[tolen - 1] == '.')
259+ tolen--;
260+
261+ if (isc_buffer_length(buffer) < used_org + tolen)
262+ return (ISC_R_NOSPACE);
263+
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);
267+
268+ return (ISC_R_SUCCESS);
269+}
270+
271+static idn_result_t
272+append_textname(char *name, const char *origin, size_t namesize) {
273+ size_t namelen = strlen(name);
274+ size_t originlen = strlen(origin);
275+
276+ /* Already absolute? */
277+ if (namelen > 0 && name[namelen - 1] == '.')
278+ return idn_success;
279+
280+ /* Append dot and origin */
281+
282+ if (namelen + 1 + originlen >= namesize)
283+ return idn_buffer_overflow;
284+
285+ name[namelen++] = '.';
286+ (void)strcpy(name + namelen, origin);
287+ return idn_success;
288+}
289+
290+static void
291+idn_check_result(idn_result_t r, const char *msg) {
292+ if (r != idn_success) {
293+ exitcode = 1;
294+ fatal("%s: %s", msg, idn_result_tostring(r));
295+ }
296+}
297+
298+#endif /* WITH_IDN */
299diff -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
302@@ -120,6 +120,17 @@
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.
306+.SH "IDN SUPPORT"
307+.PP
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
316+\fBhost\fR runs.
317 .SH "FILES"
318 .PP
319 \fI/etc/resolv.conf\fR
320diff -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
323@@ -181,6 +181,21 @@
324 </refsect1>
325
326 <refsect1>
327+<title>IDN SUPPORT</title>
328+<para>
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.
338+</para>
339+</refsect1>
340+
341+<refsect1>
342 <title>FILES</title>
343 <para>
344 <filename>/etc/resolv.conf</filename>
345diff -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
348@@ -36,7 +36,7 @@
349
350 DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
351
352-LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
353+LIBS = ${DNSLIBS} ${ISCLIBS} @IDNLIBS@ @LIBS@
354
355 SUBDIRS =
356
357diff -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
360@@ -136,6 +136,9 @@
361 /* define if you have strerror in the C library. */
362 #undef HAVE_STRERROR
363
364+/* Define if you have the setlocale function. */
365+#undef HAVE_SETLOCALE
366+
367 /* Define to 1 if you have the <dlfcn.h> header file. */
368 #undef HAVE_DLFCN_H
369
370@@ -163,6 +166,9 @@
371 /* Define to 1 if you have the <linux/capability.h> header file. */
372 #undef HAVE_LINUX_CAPABILITY_H
373
374+/* Define if you have the <locale.h> header file. */
375+#undef HAVE_LOCALE_H
376+
377 /* Define to 1 if you have the <memory.h> header file. */
378 #undef HAVE_MEMORY_H
379
380@@ -182,6 +188,10 @@
381 #undef HAVE_SYS_PRCTL_H
382
383 /* Define to 1 if you have the <sys/select.h> header file. */
384+
385+/* define if idnkit support is to be included. */
386+#undef WITH_IDN
387+
388 #undef HAVE_SYS_SELECT_H
389
390 /* Define to 1 if you have the <sys/sockio.h> header file. */
391diff -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
402
403 Some influential environment variables:
404 CC C compiler command
405@@ -13454,6 +13458,312 @@
406
407
408 #
409+# IDN support
410+#
411+
412+# Check whether --with-idn or --without-idn was given.
413+if test "${with_idn+set}" = set; then
414+ withval="$with_idn"
415+ use_idn="$withval"
416+else
417+ use_idn="no"
418+fi;
419+case "$use_idn" in
420+yes)
421+ if test X$prefix = XNONE ; then
422+ idn_path=/usr/local
423+ else
424+ idn_path=$prefix
425+ fi
426+ ;;
427+no)
428+ ;;
429+*)
430+ idn_path="$use_idn"
431+ ;;
432+esac
433+
434+iconvinc=
435+iconvlib=
436+
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"
441+else
442+ use_libiconv="no"
443+fi;
444+case "$use_libiconv" in
445+yes)
446+ if test X$prefix = XNONE ; then
447+ iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
448+ else
449+ iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
450+ fi
451+ ;;
452+no)
453+ iconvlib=
454+ ;;
455+*)
456+ iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
457+ ;;
458+esac
459+
460+
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"
465+fi;
466+case "$iconvlib" in
467+no)
468+ iconvlib=
469+ ;;
470+yes)
471+ iconvlib=-liconv
472+ ;;
473+esac
474+
475+
476+# Check whether --with-idnlib or --without-idnlib was given.
477+if test "${with_idnlib+set}" = set; then
478+ withval="$with_idnlib"
479+ idnlib="$withval"
480+else
481+ idnlib="no"
482+fi;
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; }; }
487+fi
488+
489+IDNLIBS=
490+if test "$use_idn" != no; then
491+
492+cat >>confdefs.h <<\_ACEOF
493+#define WITH_IDN 1
494+_ACEOF
495+
496+ STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
497+ if test "$idnlib" != no; then
498+ IDNLIBS="$idnlib $iconvlib"
499+ else
500+ IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
501+ fi
502+fi
503+
504+
505+
506+for ac_header in locale.h
507+do
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
514+fi
515+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
516+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
517+else
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>
526+_ACEOF
527+rm -f conftest.$ac_objext
528+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
529+ (eval $ac_compile) 2>&5
530+ ac_status=$?
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
536+ ac_status=$?
537+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
538+ (exit $ac_status); }; }; then
539+ ac_header_compiler=yes
540+else
541+ echo "$as_me: failed program was:" >&5
542+cat conftest.$ac_ext >&5
543+ac_header_compiler=no
544+fi
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
548+
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>
556+_ACEOF
557+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
558+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
559+ ac_status=$?
560+ egrep -v '^ *\+' conftest.er1 >conftest.err
561+ rm -f conftest.er1
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
567+ else
568+ ac_cpp_err=
569+ fi
570+else
571+ ac_cpp_err=yes
572+fi
573+if test -z "$ac_cpp_err"; then
574+ ac_header_preproc=yes
575+else
576+ echo "$as_me: failed program was:" >&5
577+ cat conftest.$ac_ext >&5
578+ ac_header_preproc=no
579+fi
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
583+
584+# So? What about this header?
585+case $ac_header_compiler:$ac_header_preproc in
586+ yes:no )
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;};;
591+ no:yes )
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;};;
598+esac
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
603+else
604+ eval "$as_ac_Header=$ac_header_preproc"
605+fi
606+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
607+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
608+
609+fi
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
613+_ACEOF
614+
615+fi
616+
617+done
618+
619+
620+for ac_func in setlocale
621+do
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
627+else
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
635+
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. */
640+
641+#ifdef __STDC__
642+# include <limits.h>
643+#else
644+# include <assert.h>
645+#endif
646+
647+#undef $ac_func
648+
649+/* Override any gcc2 internal prototype to avoid an error. */
650+#ifdef __cplusplus
651+extern "C"
652+{
653+#endif
654+/* We use char because int might match the return type of a gcc2
655+ builtin and then its argument prototype would still apply. */
656+char $ac_func ();
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)
661+choke me
662+#else
663+char (*f) () = $ac_func;
664+#endif
665+#ifdef __cplusplus
666+}
667+#endif
668+
669+#ifdef F77_DUMMY_MAIN
670+# ifdef __cplusplus
671+ extern "C"
672+# endif
673+ int F77_DUMMY_MAIN() { return 1; }
674+#endif
675+int
676+main ()
677+{
678+return f != $ac_func;
679+ ;
680+ return 0;
681+}
682+_ACEOF
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
686+ ac_status=$?
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
692+ ac_status=$?
693+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
694+ (exit $ac_status); }; }; then
695+ eval "$as_ac_var=yes"
696+else
697+ echo "$as_me: failed program was:" >&5
698+cat conftest.$ac_ext >&5
699+eval "$as_ac_var=no"
700+fi
701+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
702+fi
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
708+_ACEOF
709+
710+fi
711+done
712+
713+
714+#
715 # Substitutions
716 #
717
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
726diff -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)
731
732 #
733+# IDN support
734+#
735+AC_ARG_WITH(idn,
736+ [ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
737+ use_idn="$withval", use_idn="no")
738+case "$use_idn" in
739+yes)
740+ if test X$prefix = XNONE ; then
741+ idn_path=/usr/local
742+ else
743+ idn_path=$prefix
744+ fi
745+ ;;
746+no)
747+ ;;
748+*)
749+ idn_path="$use_idn"
750+ ;;
751+esac
752+
753+iconvinc=
754+iconvlib=
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
759+yes)
760+ if test X$prefix = XNONE ; then
761+ iconvlib="-L/usr/local/lib -R/usr/local/lib -liconv"
762+ else
763+ iconvlib="-L$prefix/lib -R$prefix/lib -liconv"
764+ fi
765+ ;;
766+no)
767+ iconvlib=
768+ ;;
769+*)
770+ iconvlib="-L$use_libiconv/lib -R$use_libiconv/lib -liconv"
771+ ;;
772+esac
773+
774+AC_ARG_WITH(iconv,
775+ [ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
776+ iconvlib="$withval")
777+case "$iconvlib" in
778+no)
779+ iconvlib=
780+ ;;
781+yes)
782+ iconvlib=-liconv
783+ ;;
784+esac
785+
786+AC_ARG_WITH(idnlib,
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.])
791+fi
792+
793+IDNLIBS=
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"
799+ else
800+ IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
801+ fi
802+fi
803+AC_SUBST(IDNLIBS)
804+
805+AC_CHECK_HEADERS(locale.h)
806+AC_CHECK_FUNCS(setlocale)
807+
808+#
809 # Substitutions
810 #
811 AC_SUBST(BIND9_TOP_BUILDDIR)
812diff -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
815@@ -219,6 +219,17 @@
816 */
817 #define DNS_NAME_MAXWIRE 255
818
819+#ifdef WITH_IDN
820+/*
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.
824+ */
825+typedef isc_result_t (*dns_name_totextfilter_t)(isc_buffer_t *target,
826+ unsigned int used_org,
827+ isc_boolean_t absolute);
828+#endif
829+
830 /***
831 *** Initialization
832 ***/
833@@ -1261,6 +1272,14 @@
834 *
835 */
836
837+#ifdef WITH_IDN
838+void
839+dns_name_settotextfilter(dns_name_totextfilter_t proc);
840+/*
841+ * Call 'proc' at the end of dns_name_totext.
842+ */
843+#endif /* WITH_IDN */
844+
845 #define DNS_NAME_FORMATSIZE (DNS_NAME_MAXTEXT + 1)
846 /*
847 * Suggested size of buffer passed to dns_name_format().
848diff -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
851@@ -195,6 +195,13 @@
852 /* XXXDCL make const? */
853 dns_name_t *dns_wildcardname = &wild;
854
855+#ifdef WITH_IDN
856+/*
857+ * dns_name_t to text post-conversion procedure.
858+ */
859+static dns_name_totextfilter_t totext_filter_proc = NULL;
860+#endif
861+
862 static void
863 set_offsets(const dns_name_t *name, unsigned char *offsets,
864 dns_name_t *set_name);
865@@ -1699,6 +1706,9 @@
866 unsigned int labels;
867 isc_boolean_t saw_root = ISC_FALSE;
868 char num[4];
869+#ifdef WITH_IDN
870+ unsigned int oused = target->used;
871+#endif
872
873 /*
874 * This function assumes the name is in proper uncompressed
875@@ -1876,6 +1886,10 @@
876
877 isc_buffer_add(target, tlen - trem);
878
879+#ifdef WITH_IDN
880+ if (totext_filter_proc != NULL)
881+ return ((*totext_filter_proc)(target, oused, saw_root));
882+#endif
883 return (ISC_R_SUCCESS);
884 }
885
886@@ -3340,3 +3354,9 @@
887 return (ISC_R_SUCCESS);
888 }
889
890+#ifdef WITH_IDN
891+void
892+dns_name_settotextfilter(dns_name_totextfilter_t proc) {
893+ totext_filter_proc = proc;
894+}
895+#endif
896diff -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
899@@ -0,0 +1,113 @@
900+
901+ BIND-9 IDN patch
902+
903+ Japan Network Information Center (JPNIC)
904+
905+
906+* What is this patch for?
907+
908+This patch adds internationalized domain name (IDN) support to BIND-9.
909+You'll get internationalized version of dig/host/nslookup commands.
910+
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
917+ and displayed.
918+
919+
920+* Compilation & installation
921+
922+0. Prerequisite
923+
924+You have to build and install idnkit before building this patched version
925+of bind-9.
926+
927+1. Running configure script
928+
929+Run `configure' in the top directory. See `README' for the
930+configuration options.
931+
932+This patch adds the following 4 options to `configure'. You should
933+at least specify `--with-idn' option to enable IDN support.
934+
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')
939+ is assumed.
940+
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.
946+
947+ `--with-libiconv' is shorthand option for GNU libiconv.
948+
949+ --with-libiconv=/usr/local
950+
951+ This is equivalent to:
952+
953+ --with-iconv='-L/usr/local/lib -R/usr/local/lib -liconv'
954+
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:
962+
963+ error in loading shared libraries: libiconv.so.2: cannot
964+ open shared object file
965+
966+ If both `--with-libiconv' and `--with-iconv' options are
967+ specified, `--with-iconv' is prior to `--with-libiconv'.
968+
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
976+ this patch.
977+
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"'.
986+
987+Please consult `README' for other configuration options.
988+
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.
992+
993+2. Compilation and installation
994+
995+After running "configure", just do
996+
997+ make
998+ make install
999+
1000+for compiling and installing.
1001+
1002+
1003+* Contact information
1004+
1005+Please see http//www.nic.ad.jp/en/idn/ for the latest news
1006+about idnkit and this patch.
1007+
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.
1010+
1011+
1012+; $Id$
This page took 0.17678 seconds and 4 git commands to generate.