Hi,
some of the dns records were added without the trailing '.'. Thanks to
Oliver Burtchen for reporting this.

Martin
>From e3a455ea32ac4b6286cc98bda7ef31223fab93a9 Mon Sep 17 00:00:00 2001
From: Martin Nagy <mn...@redhat.com>
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 4c81a8e..bc6c73d 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 016d46f..d584e0a 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
 
-- 
1.6.2.5

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to