On Thu, 2014-07-03 at 19:03 +0200, Martin Basti wrote: > Regresion caused by removing validation in DNSName for regular domain > names > In original code before IDNA, zones were normalized > Patch attached > _______________________________________________ > Freeipa-devel mailing list > [email protected] > https://www.redhat.com/mailman/listinfo/freeipa-devel
Subject changed to patch 0094 sorry, I attach patch again. -- Martin^2 Basti
>From ff9df6b6f7a28a0e598e20cd3308252ce836f7bb Mon Sep 17 00:00:00 2001 From: Martin Basti <[email protected]> Date: Thu, 3 Jul 2014 18:14:40 +0200 Subject: [PATCH] Non IDNA zonename should be normalized to lowercase Before IDNA support zone was normalized. --- ipalib/plugins/dns.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index c3a09e9d9d36f3bedc06407bf05d6ad47290a9b8..4c3497f6c74defbde3aa810f9d42b9c19ad870fc 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -1708,6 +1708,15 @@ def _records_idn_postprocess(record, **options): rrs.append(dnsvalue) 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): """ @@ -1727,6 +1736,7 @@ class DNSZoneBase(LDAPObject): label=_('Zone name'), doc=_('Zone name (FQDN)'), default_from=lambda name_from_ip: _reverse_zone_name(name_from_ip), + normalizer=_normalize_zone, primary_key=True, ), Str('name_from_ip?', _validate_ipnet, -- 1.8.3.1
_______________________________________________ Freeipa-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/freeipa-devel
