libads: Keep 'good' server at the head of custom KDC list
commitdcdf2d6f275f4e9ed5fa062ffc173956d2aba4dc
authorUri Simchoni <urisimchoni@gmail.com>
Mon, 18 May 2015 10:36:46 +0000 (18 13:36 +0300)
committerJeremy Allison <jra@samba.org>
Mon, 15 Jun 2015 23:29:24 +0000 (16 01:29 +0200)
tree90ebc7ca7e5740d66092ceddd8e07a0830aee962
parent2f1b84719914f6e0966708da6cc8f4150f7c2608
libads: Keep 'good' server at the head of custom KDC list

When creating a custom krb.conf file for a domain, make sure
that the DC which already answered the ldap ping is not queried
again, and is always first in the custom KDC list. This has two
advantages:
1. Avoid re-sending an ldap ping to this server
2. The generated list is made up of the servers that answered
   first. Since the DC which already answered an LDAP ping
   is typically the "last good server", this change keeps it
   out of the contest and guarantees that we keep using last
   good server as long as it works.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/libads/kerberos.c