1 |
From ed26f0f0eb4242706d2012e4abe0152071bb305b Mon Sep 17 00:00:00 2001 |
From ec50eff97c259b5bfbfa4e050d69fe7b39b0f15a Mon Sep 17 00:00:00 2001 |
2 |
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com> |
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com> |
3 |
Date: Tue, 25 Sep 2018 18:08:46 +0200 |
Date: Tue, 25 Sep 2018 18:08:46 +0200 |
4 |
Subject: [PATCH] Disable IDN from environment as documented |
Subject: [PATCH] Disable IDN from environment as documented |
12 |
RH patch since RHEL 5. |
RH patch since RHEL 5. |
13 |
--- |
--- |
14 |
bin/dig/dig.docbook | 4 +++- |
bin/dig/dig.docbook | 4 +++- |
15 |
bin/dig/dighost.c | 9 +++++++-- |
bin/dig/dighost.c | 5 +++++ |
16 |
bin/dig/host.docbook | 2 +- |
bin/dig/host.docbook | 2 +- |
17 |
bin/dig/nslookup.docbook | 15 +++++++++++++++ |
bin/dig/nslookup.docbook | 15 +++++++++++++++ |
18 |
4 files changed, 26 insertions(+), 4 deletions(-) |
4 files changed, 24 insertions(+), 2 deletions(-) |
19 |
|
|
20 |
diff --git a/bin/dig/dig.docbook b/bin/dig/dig.docbook |
diff --git a/bin/dig/dig.docbook b/bin/dig/dig.docbook |
21 |
index bd7510e..5cc696f 100644 |
index 5d19301..933af79 100644 |
22 |
--- a/bin/dig/dig.docbook |
--- a/bin/dig/dig.docbook |
23 |
+++ b/bin/dig/dig.docbook |
+++ b/bin/dig/dig.docbook |
24 |
@@ -1288,7 +1288,9 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr |
@@ -1312,7 +1312,9 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr |
25 |
reply from the server. |
reply from the server. |
26 |
If you'd like to turn off the IDN support for some reason, use |
If you'd like to turn off the IDN support for some reason, use |
27 |
parameters <parameter>+noidnin</parameter> and |
parameters <parameter>+noidnin</parameter> and |
33 |
</refsection> |
</refsection> |
34 |
|
|
35 |
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c |
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c |
36 |
index 341ed80..bb8702c 100644 |
index 5eabc1f..73aaab8 100644 |
37 |
--- a/bin/dig/dighost.c |
--- a/bin/dig/dighost.c |
38 |
+++ b/bin/dig/dighost.c |
+++ b/bin/dig/dighost.c |
39 |
@@ -825,12 +825,17 @@ make_empty_lookup(void) { |
@@ -826,6 +826,11 @@ make_empty_lookup(void) { |
|
looknew->seenbadcookie = false; |
|
40 |
looknew->badcookie = true; |
looknew->badcookie = true; |
41 |
#ifdef WITH_IDN_SUPPORT |
#ifdef WITH_IDN_SUPPORT |
42 |
- looknew->idnin = true; |
looknew->idnin = isatty(1)?(getenv("IDN_DISABLE") == NULL):false; |
|
+ looknew->idnin = (getenv("IDN_DISABLE") == NULL); |
|
43 |
+ if (looknew->idnin) { |
+ if (looknew->idnin) { |
44 |
+ const char *charset = getenv("CHARSET"); |
+ const char *charset = getenv("CHARSET"); |
45 |
+ if (charset && !strcmp(charset, "ASCII")) |
+ if (charset && !strcmp(charset, "ASCII")) |
48 |
#else |
#else |
49 |
looknew->idnin = false; |
looknew->idnin = false; |
50 |
#endif |
#endif |
|
#ifdef WITH_IDN_OUT_SUPPORT |
|
|
- looknew->idnout = true; |
|
|
+ looknew->idnout = looknew->idnin; |
|
|
#else |
|
|
looknew->idnout = false; |
|
|
#endif |
|
51 |
diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook |
diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook |
52 |
index 9c3aeaa..42cbbf9 100644 |
index da0f8fb..9689b5a 100644 |
53 |
--- a/bin/dig/host.docbook |
--- a/bin/dig/host.docbook |
54 |
+++ b/bin/dig/host.docbook |
+++ b/bin/dig/host.docbook |
55 |
@@ -378,7 +378,7 @@ |
@@ -379,7 +379,7 @@ |
56 |
<command>host</command> appropriately converts character encoding of |
<command>host</command> appropriately converts character encoding of |
57 |
domain name before sending a request to DNS server or displaying a |
domain name before sending a request to DNS server or displaying a |
58 |
reply from the server. |
reply from the server. |
62 |
The IDN support is disabled if the variable is set when |
The IDN support is disabled if the variable is set when |
63 |
<command>host</command> runs. |
<command>host</command> runs. |
64 |
diff --git a/bin/dig/nslookup.docbook b/bin/dig/nslookup.docbook |
diff --git a/bin/dig/nslookup.docbook b/bin/dig/nslookup.docbook |
65 |
index 3aff4e9..86a09c6 100644 |
index d46fc2d..6d7d181 100644 |
66 |
--- a/bin/dig/nslookup.docbook |
--- a/bin/dig/nslookup.docbook |
67 |
+++ b/bin/dig/nslookup.docbook |
+++ b/bin/dig/nslookup.docbook |
68 |
@@ -478,6 +478,21 @@ nslookup -query=hinfo -timeout=10 |
@@ -495,6 +495,21 @@ nslookup -query=hinfo -timeout=10 |
69 |
</para> |
</para> |
70 |
</refsection> |
</refsection> |
71 |
|
|
88 |
|
|
89 |
<para><filename>/etc/resolv.conf</filename> |
<para><filename>/etc/resolv.conf</filename> |
90 |
-- |
-- |
91 |
2.14.4 |
2.20.1 |
92 |
|
|