mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add SRV record target validator
Add missing SRV record target validator to filter out possible user errors. https://fedorahosted.org/freeipa/ticket/2308
This commit is contained in:
@@ -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'),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user