bind/bind-9.11-rh1647829-2.patch
Petr Menšík 7a958a2a9f Disable dig IDN output into scripts
Dig could be used to receive zone via AXFR. If IDN data are inside and
are decoded, it cannot be used as named zone file. Disable +idnout if
stdin is not a tty.
2019-02-07 10:46:05 +01:00

29 lines
1016 B
Diff

From 58e1af6ca75d035b6391708be2c2272bb8d04620 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@sury.org>
Date: Sun, 4 Nov 2018 02:20:41 +0700
Subject: [PATCH] Enable IDN processing (both idnin and idnout) only on tty,
disable it when the stdout is not a tty
(cherry picked from commit 0e1bf7d017e4f6d787cbeb72cc2aa74e7f30122e)
(cherry picked from commit 8e1cc95c943b7dfaaaaf2d9a4971861735cc3fb2)
---
bin/dig/dighost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index 74791d671e..3b722ba0ff 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -825,7 +825,7 @@ make_empty_lookup(void) {
looknew->seenbadcookie = false;
looknew->badcookie = true;
#ifdef WITH_IDN_SUPPORT
- looknew->idnin = (getenv("IDN_DISABLE") == NULL);
+ looknew->idnin = isatty(1)?(getenv("IDN_DISABLE") == NULL):false;
if (looknew->idnin) {
const char *charset = getenv("CHARSET");
if (charset && !strcmp(charset, "ASCII"))
--
2.20.1