summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipaclient/ipadiscovery.py
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-10-05 17:25:09 +0300
committerRob Crittenden <rcritten@redhat.com>2011-10-06 05:17:08 -0400
commit60bacc23a0989c7f9c060d8c209ba4396546ec89 (patch)
treeb2acd3c218ea9dc243b96863dbbf697da43af2b8 /ipa-client/ipaclient/ipadiscovery.py
parent6f38cc42e73704f15c110c8bfbdffba8ea6f455a (diff)
downloadfreeipa-60bacc23a0989c7f9c060d8c209ba4396546ec89.tar.gz
freeipa-60bacc23a0989c7f9c060d8c209ba4396546ec89.tar.xz
freeipa-60bacc23a0989c7f9c060d8c209ba4396546ec89.zip
Before kinit, try to sync time with the NTP servers of the domain we are joining
When running ipa-client-install on a system whose clock is not in sync with the master, kinit fails and enrollment is aborted. Manual checking of current time at the master and adjusting on the client-to-be is then needed. The patch tries to fetch SRV records for NTP servers of the domain we aim to join and runs ntpdate to get time synchronized. If no SRV records are found, sync with IPA server itself. If that fails, warn that time might be not in sync with KDC. https://fedorahosted.org/freeipa/ticket/1773
Diffstat (limited to 'ipa-client/ipaclient/ipadiscovery.py')
-rw-r--r--ipa-client/ipaclient/ipadiscovery.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/ipa-client/ipaclient/ipadiscovery.py b/ipa-client/ipaclient/ipadiscovery.py
index 3e31cad37..cd5f81bd5 100644
--- a/ipa-client/ipaclient/ipadiscovery.py
+++ b/ipa-client/ipaclient/ipadiscovery.py
@@ -316,6 +316,27 @@ class IPADiscovery:
return servers
+ def ipadnssearchntp(self, tdomain):
+ servers = ""
+ rserver = ""
+
+ qname = "_ntp._udp."+tdomain
+ # terminate the name
+ if not qname.endswith("."):
+ qname += "."
+ results = ipapython.dnsclient.query(qname, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
+
+ for result in results:
+ if result.dns_type == ipapython.dnsclient.DNS_T_SRV:
+ rserver = result.rdata.server.rstrip(".")
+ if servers:
+ servers += "," + rserver
+ else:
+ servers = rserver
+ break
+
+ return servers
+
def ipadnssearchkrb(self, tdomain):
realm = None
kdc = None