summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/dns.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-02-03 14:25:53 +0100
committerMartin Kosek <mkosek@redhat.com>2012-02-03 16:25:53 +0100
commite1fecfaf6a9f35d23105661292dea7d68b1cc19c (patch)
treecff67d667454ace14342c0acb7f6d4da40e73b28 /ipalib/plugins/dns.py
parentcb4b2e6facea8fd786384ceb751e6dbedac2be5c (diff)
downloadfreeipa-e1fecfaf6a9f35d23105661292dea7d68b1cc19c.tar.gz
freeipa-e1fecfaf6a9f35d23105661292dea7d68b1cc19c.tar.xz
freeipa-e1fecfaf6a9f35d23105661292dea7d68b1cc19c.zip
Add SRV record target validator
Add missing SRV record target validator to filter out possible user errors. https://fedorahosted.org/freeipa/ticket/2308
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r--ipalib/plugins/dns.py7
1 files changed, 7 insertions, 0 deletions
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'),
),