Hello,

Fix ipa-adtrust-install to always generate SRV records with FQDNs

Previous code failed in following setup:
* IPA domain = ipa.example.com
* IPA master = vm1.example.com
* IPA replica = vm2.example.com

https://fedorahosted.org/freeipa/ticket/5663

-- 
Petr^2 Spacek
From d4d13e003b9fb7153e27691d67246b0dfa4b51ac Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Tue, 2 Feb 2016 17:20:21 +0100
Subject: [PATCH] Fix ipa-adtrust-install to always generate SRV records with
 FQDNs

Previous code failed in following setup:
* IPA domain = ipa.example.com
* IPA master = vm1.example.com
* IPA replica = vm2.example.com

https://fedorahosted.org/freeipa/ticket/5663
---
 ipaserver/install/adtrustinstance.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py
index 118f848cf33c3126d42ccda555a8308f52d2c390..9e7e001f7c505d09d5a61164399e9ed256ae9865 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -571,12 +571,7 @@ class ADTRUSTInstance(service.Service):
         """
 
         zone = self.domain_name
-        host, host_domain = self.fqdn.split(".", 1)
-
-        if normalize_zone(zone) == normalize_zone(host_domain):
-            host_in_rr = host
-        else:
-            host_in_rr = normalize_zone(self.fqdn)
+        host_in_rr = normalize_zone(self.fqdn)
 
         priority = 0
 
@@ -707,7 +702,7 @@ class ADTRUSTInstance(service.Service):
                             # this is CIFS service of a different host in our
                             # REALM, we need to remember it to announce via
                             # SRV records for _msdcs
-                            self.cifs_hosts.append(fqdn.split(".")[0])
+                            self.cifs_hosts.append(normalize_zone(fqdn))
 
         except Exception as e:
             root_logger.critical("Checking replicas for cifs principals failed with error '%s'" % e)
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to