libnet_join: use sitename if it was set by pre-join detection
authorAlexander Bokovoy <ab@samba.org>
Tue, 14 Jun 2016 19:37:31 +0000 (22:37 +0300)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 15 Jun 2016 13:25:44 +0000 (15:25 +0200)
commit4c408f6de5c32a41fbb44971419118e5425d13e7
tree1e656369e1365fa921927909cceb6bd4daff404c
parent46916b24e9c8b56a14152488e270a05064cf4586
libnet_join: use sitename if it was set by pre-join detection

When domain member is joined to AD, we need to use the same DC to
authenticate against after the join because the machine account might
not be replicated yet to other domain controllers, including off-site.

Bug https://bugzilla.samba.org/show_bug.cgi?id=11769 dealt with
detection of the site pre-join. However, we rewrite private local
krb5.conf afterwards without taking the discovered site name into
account.

Fix this by reusing the site discovered pre-join.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11975

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Jun 15 15:25:44 CEST 2016 on sn-devel-144
source3/libnet/libnet_join.c