From 63dc193ff79206d6d4754024db70a84a4cd4cc67 Mon Sep 17 00:00:00 2001 From: mortzu Date: Tue, 30 Dec 2014 10:54:56 +0100 Subject: [PATCH] (r)zongen.py: Fix maximum label length --- rzonegen.py | 2 +- zonegen.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rzonegen.py b/rzonegen.py index 72f8351..f3759dc 100755 --- a/rzonegen.py +++ b/rzonegen.py @@ -12,7 +12,7 @@ def str_to_domainlabel(s): label = re.sub("^-*", "", label) label = re.sub("-*$", "", label) - if not re.match("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$", label): + if not re.match("^[a-zA-Z][a-zA-Z0-9-]{,61}[a-zA-Z0-9]$", label): raise RuntimeError("Not convertable to a domain label: %s" % s) return label diff --git a/zonegen.py b/zonegen.py index 0573c2f..3184871 100755 --- a/zonegen.py +++ b/zonegen.py @@ -12,7 +12,7 @@ def str_to_domainlabel(s): label = re.sub("^-*", "", label) label = re.sub("-*$", "", label) - if not re.match("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$", label): + if not re.match("^[a-zA-Z][a-zA-Z0-9-]{,61}[a-zA-Z0-9]$", label): raise RuntimeError("Not convertable to a domain label: %s" % s) return label