|
|
1e4169 |
From ec50eff97c259b5bfbfa4e050d69fe7b39b0f15a Mon Sep 17 00:00:00 2001
|
|
|
e665b7 |
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
|
|
e665b7 |
Date: Tue, 25 Sep 2018 18:08:46 +0200
|
|
|
e665b7 |
Subject: [PATCH] Disable IDN from environment as documented
|
|
|
e665b7 |
|
|
|
e665b7 |
Manual page of host contained instructions to disable IDN processing
|
|
|
e665b7 |
when it was built with libidn2. When refactoring IDN support however,
|
|
|
e665b7 |
support for disabling IDN in host and nslookup was lost. Use also
|
|
|
e665b7 |
environment variable and document it for nslookup, host and dig.
|
|
|
e665b7 |
|
|
|
e665b7 |
Support variable CHARSET=ASCII to disable IDN, supported in downstream
|
|
|
e665b7 |
RH patch since RHEL 5.
|
|
|
e665b7 |
---
|
|
|
e665b7 |
bin/dig/dig.docbook | 4 +++-
|
|
|
1e4169 |
bin/dig/dighost.c | 5 +++++
|
|
|
e665b7 |
bin/dig/host.docbook | 2 +-
|
|
|
e665b7 |
bin/dig/nslookup.docbook | 15 +++++++++++++++
|
|
|
1e4169 |
4 files changed, 24 insertions(+), 2 deletions(-)
|
|
|
e665b7 |
|
|
|
e665b7 |
diff --git a/bin/dig/dig.docbook b/bin/dig/dig.docbook
|
|
|
1e4169 |
index 5d19301..933af79 100644
|
|
|
e665b7 |
--- a/bin/dig/dig.docbook
|
|
|
e665b7 |
+++ b/bin/dig/dig.docbook
|
|
|
1e4169 |
@@ -1312,7 +1312,9 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
|
|
|
e665b7 |
reply from the server.
|
|
|
e665b7 |
If you'd like to turn off the IDN support for some reason, use
|
|
|
e665b7 |
parameters <parameter>+noidnin</parameter> and
|
|
|
e665b7 |
- <parameter>+noidnout</parameter>.
|
|
|
e665b7 |
+ <parameter>+noidnout</parameter> or define
|
|
|
e665b7 |
+ the <envar>IDN_DISABLE</envar> environment variable.
|
|
|
e665b7 |
+
|
|
|
e665b7 |
</para>
|
|
|
e665b7 |
</refsection>
|
|
|
e665b7 |
|
|
|
e665b7 |
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
|
|
|
1e4169 |
index 5eabc1f..73aaab8 100644
|
|
|
e665b7 |
--- a/bin/dig/dighost.c
|
|
|
e665b7 |
+++ b/bin/dig/dighost.c
|
|
|
1e4169 |
@@ -826,6 +826,11 @@ make_empty_lookup(void) {
|
|
|
ad7b3b |
looknew->badcookie = true;
|
|
|
e665b7 |
#ifdef WITH_IDN_SUPPORT
|
|
|
1e4169 |
looknew->idnin = isatty(1)?(getenv("IDN_DISABLE") == NULL):false;
|
|
|
e665b7 |
+ if (looknew->idnin) {
|
|
|
e665b7 |
+ const char *charset = getenv("CHARSET");
|
|
|
e665b7 |
+ if (charset && !strcmp(charset, "ASCII"))
|
|
|
ad7b3b |
+ looknew->idnin = false;
|
|
|
e665b7 |
+ }
|
|
|
e665b7 |
#else
|
|
|
ad7b3b |
looknew->idnin = false;
|
|
|
e665b7 |
#endif
|
|
|
e665b7 |
diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook
|
|
|
1e4169 |
index da0f8fb..9689b5a 100644
|
|
|
e665b7 |
--- a/bin/dig/host.docbook
|
|
|
e665b7 |
+++ b/bin/dig/host.docbook
|
|
|
1e4169 |
@@ -379,7 +379,7 @@
|
|
|
e665b7 |
<command>host</command> appropriately converts character encoding of
|
|
|
e665b7 |
domain name before sending a request to DNS server or displaying a
|
|
|
e665b7 |
reply from the server.
|
|
|
e665b7 |
- If you'd like to turn off the IDN support for some reason, defines
|
|
|
e665b7 |
+ If you'd like to turn off the IDN support for some reason, define
|
|
|
e665b7 |
the <envar>IDN_DISABLE</envar> environment variable.
|
|
|
e665b7 |
The IDN support is disabled if the variable is set when
|
|
|
e665b7 |
<command>host</command> runs.
|
|
|
e665b7 |
diff --git a/bin/dig/nslookup.docbook b/bin/dig/nslookup.docbook
|
|
|
1e4169 |
index d46fc2d..6d7d181 100644
|
|
|
e665b7 |
--- a/bin/dig/nslookup.docbook
|
|
|
e665b7 |
+++ b/bin/dig/nslookup.docbook
|
|
|
1e4169 |
@@ -495,6 +495,21 @@ nslookup -query=hinfo -timeout=10
|
|
|
e665b7 |
</para>
|
|
|
e665b7 |
</refsection>
|
|
|
e665b7 |
|
|
|
e665b7 |
+ <refsection><info><title>IDN SUPPORT</title></info>
|
|
|
e665b7 |
+
|
|
|
e665b7 |
+ <para>
|
|
|
e665b7 |
+ If <command>nslookup</command> has been built with IDN (internationalized
|
|
|
e665b7 |
+ domain name) support, it can accept and display non-ASCII domain names.
|
|
|
e665b7 |
+ <command>nslookup</command> appropriately converts character encoding of
|
|
|
e665b7 |
+ domain name before sending a request to DNS server or displaying a
|
|
|
e665b7 |
+ reply from the server.
|
|
|
e665b7 |
+ If you'd like to turn off the IDN support for some reason, define
|
|
|
e665b7 |
+ the <envar>IDN_DISABLE</envar> environment variable.
|
|
|
e665b7 |
+ The IDN support is disabled if the variable is set when
|
|
|
e665b7 |
+ <command>nslookup</command> runs.
|
|
|
e665b7 |
+ </para>
|
|
|
e665b7 |
+ </refsection>
|
|
|
e665b7 |
+
|
|
|
e665b7 |
<refsection><info><title>FILES</title></info>
|
|
|
e665b7 |
|
|
|
e665b7 |
<para><filename>/etc/resolv.conf</filename>
|
|
|
e665b7 |
--
|
|
|
1e4169 |
2.20.1
|
|
|
e665b7 |
|