From 04182bf68fca4ff259314ec7c0a84a447866ec0f Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Mon, 19 Apr 2010 03:39:52 +0200 Subject: [PATCH] Add forgotten trailing dots in DNS records 583023 --- ipalib/plugins/dns.py | 9 ++++++++- ipaserver/install/bindinstance.py | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index 4c81a8e7c..bc6c73d88 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -95,6 +95,13 @@ _zone_default_attributes = [ ] +# normalizer for admin email +def _rname_normalizer(value): + value = value.replace('@', '.') + if not value.endswith('.'): + value += '.' + return value + # build zone dn def _get_zone_dn(ldap, idnsname): rdn = ldap.make_rdn_from_attr('idnsname', idnsname) @@ -129,7 +136,7 @@ class dns(Object): cli_name='admin_email', label=_('administrator e-mail address'), default_from=lambda idnsname: 'root.%s' % idnsname, - normalizer=lambda value: value.replace('@', '.'), + normalizer=_rname_normalizer, ), Int('idnssoaserial?', cli_name='serial', diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index 016d46fbd..d584e0af8 100644 --- a/ipaserver/install/bindinstance.py +++ b/ipaserver/install/bindinstance.py @@ -93,7 +93,7 @@ def add_zone(name, update_policy=None, dns_backup=None): try: api.Command.dns_add(unicode(name), - idnssoamname=unicode(api.env.host), + idnssoamname=unicode(api.env.host+"."), idnsallowdynupdate=True, idnsupdatepolicy=unicode(update_policy)) except (errors.DuplicateEntry, errors.EmptyModlist): @@ -109,13 +109,13 @@ def add_reverze_zone(ip_address, update_policy=None, dns_backup=None): update_policy = "grant %s krb5-subdomain %s. PTR;" % (api.env.realm, zone) try: api.Command.dns_add(unicode(zone), - idnssoamname=unicode(api.env.host), + idnssoamname=unicode(api.env.host+"."), idnsallowdynupdate=True, idnsupdatepolicy=unicode(update_policy)) except (errors.DuplicateEntry, errors.EmptyModlist): pass - add_rr(zone, "@", "NS", api.env.host, dns_backup) + add_rr(zone, "@", "NS", api.env.host+".", dns_backup) return zone