ignore some files
[tridge/bind9.git] / contrib / idn / idnkit-1.0-src / tools / runidn / runidn.1
1 .\" $Id: runidn.1,v 1.1.1.1 2003/06/04 00:27:14 marka Exp $
2 .\"
3 .\" Copyright (c) 2000,2001 Japan Network Information Center.
4 .\" All rights reserved.
5 .\"  
6 .\" By using this file, you agree to the terms and conditions set forth bellow.
7 .\" 
8 .\"                     LICENSE TERMS AND CONDITIONS 
9 .\" 
10 .\" The following License Terms and Conditions apply, unless a different
11 .\" license is obtained from Japan Network Information Center ("JPNIC"),
12 .\" a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
13 .\" Chiyoda-ku, Tokyo 101-0047, Japan.
14 .\" 
15 .\" 1. Use, Modification and Redistribution (including distribution of any
16 .\"    modified or derived work) in source and/or binary forms is permitted
17 .\"    under this License Terms and Conditions.
18 .\" 
19 .\" 2. Redistribution of source code must retain the copyright notices as they
20 .\"    appear in each source code file, this License Terms and Conditions.
21 .\" 
22 .\" 3. Redistribution in binary form must reproduce the Copyright Notice,
23 .\"    this License Terms and Conditions, in the documentation and/or other
24 .\"    materials provided with the distribution.  For the purposes of binary
25 .\"    distribution the "Copyright Notice" refers to the following language:
26 .\"    "Copyright (c) 2000-2002 Japan Network Information Center.  All rights reserved."
27 .\" 
28 .\" 4. The name of JPNIC may not be used to endorse or promote products
29 .\"    derived from this Software without specific prior written approval of
30 .\"    JPNIC.
31 .\" 
32 .\" 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
33 .\"    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 .\"    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
35 .\"    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL JPNIC BE LIABLE
36 .\"    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
37 .\"    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38 .\"    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
39 .\"    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
40 .\"    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
41 .\"    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
42 .\"    ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
43 .\"
44 .TH RUNIDN 1 "April 6, 2001"
45 .\"
46 .SH NAME
47 runidn \- A script to allow applications to use internationalized domain names.
48 .\"
49 .SH SYNOPSIS
50 \fBrunidn\fP [\fB-e\fP \fIlocal-codeset\fP] \fIprogram-name\fP [\fIargs..\fP]
51 .\"
52 .SH DESCRIPTION
53 \fBrunidn\fP enables applications to use internationalized domain names
54 without recompilation.
55 Just add ``runidn'' before the application-name, and the application
56 can handle non-ASCII domain names.  For example, you can do:
57 .PP
58 .RS 4
59 .nf
60 \f(CW% runidn telnet \fInon-ASCII-hostname\fR
61 .fi
62 .RE
63 .PP
64 Before using runidn, you should set up properties related to
65 internationalized DNS by configuring idnkit's configuration file
66 \fBidn.conf\fP.
67 See idn.conf(5) which describes the configuration.
68 .\"
69 .SH OPTION
70 The following option is available:
71 .TP 4
72 \fB\-e\fP \fIlocal-codeset\fP
73 Specify the application's local codeset.
74 If the option is not specified, \fBrunidn\fR guesses the codeset
75 from the current locale.
76 See the ``NOTE'' section for more details about local codeset.
77 .\"
78 .SH IMPLEMENTATION
79 \fBrunidn\fR is a small shell script that sets up an environment variable
80 called ``LD_PRELOAD'', so that an application dynamically links a shared
81 library ``libidnkitres'' before any other shared libraries.
82 .PP
83 The library ``libidnkitres'' provides a special version of resolver
84 functions which implement features for handling internationalized
85 domain names.
86 \fBrunidn\fR replaces the following functions with the special version:
87 .PP
88 .RS 4
89 .nf
90 .ft CW
91 gethostbyname
92 gethostbyname2
93 gethostbyaddr
94 gethostbyname_r
95 gethostbyname2_r
96 gethostbyaddr_r
97 getipnodebyname
98 getipnodebyaddr
99 freehostent
100 getaddrinfo
101 freeaddrinfo
102 getnameinfo
103 .ft R
104 .fi
105 .RE
106 .PP
107 By overriding them in the standard libraries with the special version
108 provided by ``libidnkitres'',
109 \fBrunidn\fR enables applications to use internationalized domain names.
110 .RS 4
111 .IP \(bu 2
112 These API functions accept non-ASCII domain names encoded
113 in the local codeset that the application is using.
114 Also the result from these APIs may contain non-ASCII domain names.
115 .IP \(bu 2
116 The normalization and codeset conversion between application's local
117 codeset and the codeset used in DNS protocol data are handled
118 automatically, so users/applications need not worry about them.
119 .RE
120 .PP
121 Properties of internationalized DNS (such as the normalization or
122 the codeset used on DNS protocol data) can be configured with the
123 idnkit's configuration file (\fBidn.conf\fR).
124 See idn.conf(5) for details.
125 .\"
126 .SH NOTE
127 Unless \fB\-e\fP option is specified, \fBrunidn\fR tries to guess
128 the application's local codeset from the application's current locale.
129 However, sometimes it cannot guess the codeset correctly, for example
130 if the application does not set the locale appropriately by calling
131 `setlocale()'.
132 In that case, you can explicitly specify the local codeset by setting an
133 environment variable ``IDN_LOCAL_CODESET''.
134 See the section ``LOCAL CODESET'' in idn.conf(5) for details.
135 .PP
136 The idea of using ``LD_PRELOAD'' to replace some functions in the standard
137 library was taken from ``runsocks'' script distributed as part of SOCKS5
138 reference implementation.
139 .SH BUGS
140 There are many cases where \fBrunidn\fR does not work.
141 .PP
142 Your system must support ``LD_PRELOAD'' mechanism in the first place.
143 .PP
144 Due to security reasons, ``LD_PRELOAD'' mechanism is disabled for
145 setuid programs in any sane systems.
146 So \fBrunidn\fR does not work for setuid programs such as ping or rsh.
147 .PP
148 If your application uses a function other than the ones runidn supports for
149 name resolution, you lose.
150 .SH "SEE ALSO"
151 idn.conf(5), runsocks(1)