summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-09-27 07:45:32 -0400
committerMartin Kosek <mkosek@redhat.com>2012-09-27 16:01:35 +0200
commitf50034a6d1ed7a45153c2df9eb359a1acc361079 (patch)
treed14f2a36306fde45441ed4f8607d1801d992db63 /ipalib
parenta91e36a18e8dc9c38e42eb864fcbe565371f4b09 (diff)
downloadfreeipa.git-f50034a6d1ed7a45153c2df9eb359a1acc361079.tar.gz
freeipa.git-f50034a6d1ed7a45153c2df9eb359a1acc361079.tar.xz
freeipa.git-f50034a6d1ed7a45153c2df9eb359a1acc361079.zip
Fix NS records in installation
Our installation added two final dots to the NS records, so the records were invalid, Bind ignored the entire zone, and name resolution didn't work. Fix this error and add a check for empty DNS labels to the validator
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/util.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index 53b6c80c..ca14aee3 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -266,6 +266,9 @@ def validate_hostname(hostname, check_fqdn=True, allow_underscore=False):
if hostname.endswith('.'):
hostname = hostname[:-1]
+ if '..' in hostname:
+ raise ValueError(_('hostname contains empty label (consecutive dots)'))
+
if '.' not in hostname:
if check_fqdn:
raise ValueError(_('not fully qualified'))