summaryrefslogtreecommitdiff
path: root/net-dns/valtz/files/allow-underscores-in-records.patch
diff options
context:
space:
mode:
Diffstat (limited to 'net-dns/valtz/files/allow-underscores-in-records.patch')
-rw-r--r--net-dns/valtz/files/allow-underscores-in-records.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/net-dns/valtz/files/allow-underscores-in-records.patch b/net-dns/valtz/files/allow-underscores-in-records.patch
new file mode 100644
index 000000000000..b76b231e6f15
--- /dev/null
+++ b/net-dns/valtz/files/allow-underscores-in-records.patch
@@ -0,0 +1,48 @@
+From 7c5df8ad5c18a9f8b9440dbd1ae4faacf55b452a Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Thu, 5 Dec 2019 10:34:54 -0500
+Subject: [PATCH 1/3] Allow underscore characters in FQDNs and pointers.
+
+Modern DNS records can contain underscores for a number of reasons. In
+particular, DKIM records involve a "_domainkey" part,
+
+ https://tools.ietf.org/html/rfc6376
+
+that is rejected by the current "fqdn" and "p" validation routines.
+Moreover, any SRV records will have a service name prefixed with an
+underscore:
+
+ https://tools.ietf.org/html/rfc2782
+
+To recognize these tokens as valid, this commit expands the "fqdn" and
+"p" regular expressions to allow underscores as the first character in
+each component of an FQDN.
+---
+ valtz | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/valtz b/valtz
+index c68c120..eebda76 100644
+--- a/valtz
++++ b/valtz
+@@ -202,7 +202,7 @@ my %token_validator = (
+ # check all parts
+ for my $hostpart (split /\./, $s)
+ {
+- return 1005 unless $hostpart =~ /^[-a-z0-9]+$/i;
++ return 1005 unless $hostpart =~ /^_?[-a-z0-9]+$/i;
+ return 1006 if $hostpart =~ /^-/;
+ return 1007 if $hostpart =~ /-$/;
+ }
+@@ -268,7 +268,7 @@ my %token_validator = (
+ # check all parts
+ for (split /\./, $s)
+ {
+- return 1005 unless /^[-[a-z0-9]+$/i;
++ return 1005 unless /^_?[-[a-z0-9]+$/i;
+ return 1006 if /^-/;
+ return 1007 if /-$/;
+ }
+--
+2.23.0
+