mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Allow underscore in record targets
Makes record target validation less strict and allows underscore. This is requirement for IPA sites. https://fedorahosted.org/freeipa/ticket/3550
This commit is contained in:
committed by
Martin Kosek
parent
4cff518517
commit
2973128cf0
@@ -373,7 +373,7 @@ def _bind_hostname_validator(ugettext, value):
|
||||
try:
|
||||
# Allow domain name which is not fully qualified. These are supported
|
||||
# in bind and then translated as <non-fqdn-name>.<domain>.
|
||||
validate_hostname(value, check_fqdn=False)
|
||||
validate_hostname(value, check_fqdn=False, allow_underscore=True)
|
||||
except ValueError, e:
|
||||
return _('invalid domain-name: %s') \
|
||||
% unicode(e)
|
||||
|
||||
@@ -677,7 +677,7 @@ class test_dns(Declarative):
|
||||
'srv_part_port' : 123,
|
||||
'srv_part_target' : u'foo bar'}),
|
||||
expected=errors.ValidationError(name='srv_target',
|
||||
error=u'invalid domain-name: only letters, numbers, and - ' +
|
||||
error=u'invalid domain-name: only letters, numbers, _, and - ' +
|
||||
u'are allowed. DNS label may not start or end with -'),
|
||||
),
|
||||
|
||||
@@ -780,7 +780,7 @@ class test_dns(Declarative):
|
||||
desc='Try to add invalid CNAME record %r using dnsrecord_add' % (dnsrescname),
|
||||
command=('dnsrecord_add', [dnszone1, dnsrescname], {'cnamerecord': u'-.example.com'}),
|
||||
expected=errors.ValidationError(name='hostname',
|
||||
error=u'invalid domain-name: only letters, numbers, and - ' +
|
||||
error=u'invalid domain-name: only letters, numbers, _, and - ' +
|
||||
u'are allowed. DNS label may not start or end with -'),
|
||||
),
|
||||
|
||||
@@ -849,7 +849,7 @@ class test_dns(Declarative):
|
||||
desc='Try to add invalid DNAME record %r using dnsrecord_add' % (dnsresdname),
|
||||
command=('dnsrecord_add', [dnszone1, dnsresdname], {'dnamerecord': u'-.example.com.'}),
|
||||
expected=errors.ValidationError(name='target',
|
||||
error=u'invalid domain-name: only letters, numbers, and - ' +
|
||||
error=u'invalid domain-name: only letters, numbers, _, and - ' +
|
||||
u'are allowed. DNS label may not start or end with -'),
|
||||
),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user