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