From e1fecfaf6a9f35d23105661292dea7d68b1cc19c Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Fri, 3 Feb 2012 14:25:53 +0100 Subject: Add SRV record target validator Add missing SRV record target validator to filter out possible user errors. https://fedorahosted.org/freeipa/ticket/2308 --- ipalib/plugins/dns.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ipalib/plugins/dns.py') diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index d296f66d..a975d4db 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -888,6 +888,12 @@ class RPRecord(DNSRecord): rfc = 1183 supported = False +def _srv_target_validator(ugettext, value): + if value == u'.': + # service not available + return + return _domain_name_validator(ugettext, value) + class SRVRecord(DNSRecord): rrtype = 'SRV' rfc = 2782 @@ -908,6 +914,7 @@ class SRVRecord(DNSRecord): maxvalue=65535, ), Str('target', + _srv_target_validator, label=_('Target'), doc=_('The domain name of the target host or \'.\' if the service is decidedly not available at this domain'), ), -- cgit