only search for Kerberos SRV records when autodiscovery was requested

When a list of servers is passed to ipa-client-{install,automount} the search
of Kerberos and LDAP SRV records should be suppressed and the specified
hostnames used directly as LDAP servers/KDCs. We thus should not performed
search for KDCs when the autodiscovery was actually not requested.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Martin Babinsky 2016-03-07 17:41:15 +01:00 committed by Martin Basti
parent 578cff9567
commit 8290d4b4cb

View File

@ -273,9 +273,13 @@ class IPADiscovery(object):
if not servers and not realm: if not servers and not realm:
return REALM_NOT_FOUND return REALM_NOT_FOUND
self.kdc = self.ipadnssearchkrbkdc() if autodiscovered:
self.kdc_source = ( self.kdc = self.ipadnssearchkrbkdc()
'Discovered Kerberos DNS records from %s' % self.domain) self.kdc_source = (
'Discovered Kerberos DNS records from %s' % self.domain)
else:
self.kdc = ', '.join(servers)
self.kdc_source = "Kerberos DNS record discovery bypassed"
# We may have received multiple servers corresponding to the domain # We may have received multiple servers corresponding to the domain
# Iterate through all of those to check if it is IPA LDAP server # Iterate through all of those to check if it is IPA LDAP server