mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
Non IDNA zonename should be normalized to lowercase
Before IDNA support zone was normalized. Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
parent
6f2451ce9e
commit
29951ada9f
@ -1708,6 +1708,15 @@ def _records_idn_postprocess(record, **options):
|
|||||||
rrs.append(dnsvalue)
|
rrs.append(dnsvalue)
|
||||||
record[attr] = rrs
|
record[attr] = rrs
|
||||||
|
|
||||||
|
def _normalize_zone(zone):
|
||||||
|
if isinstance(zone, unicode):
|
||||||
|
# normalize only non-IDNA zones
|
||||||
|
try:
|
||||||
|
return unicode(zone.encode('ascii')).lower()
|
||||||
|
except UnicodeError:
|
||||||
|
pass
|
||||||
|
return zone
|
||||||
|
|
||||||
|
|
||||||
class DNSZoneBase(LDAPObject):
|
class DNSZoneBase(LDAPObject):
|
||||||
"""
|
"""
|
||||||
@ -1727,6 +1736,7 @@ class DNSZoneBase(LDAPObject):
|
|||||||
label=_('Zone name'),
|
label=_('Zone name'),
|
||||||
doc=_('Zone name (FQDN)'),
|
doc=_('Zone name (FQDN)'),
|
||||||
default_from=lambda name_from_ip: _reverse_zone_name(name_from_ip),
|
default_from=lambda name_from_ip: _reverse_zone_name(name_from_ip),
|
||||||
|
normalizer=_normalize_zone,
|
||||||
primary_key=True,
|
primary_key=True,
|
||||||
),
|
),
|
||||||
Str('name_from_ip?', _validate_ipnet,
|
Str('name_from_ip?', _validate_ipnet,
|
||||||
|
Loading…
Reference in New Issue
Block a user