s4/libnet: Fix joining a Windows pre-2008R2 DC
authorTim Beale <timbeale@catalyst.net.nz>
Mon, 1 Jul 2019 05:06:31 +0000 (17:06 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 4 Jul 2019 22:49:23 +0000 (22:49 +0000)
commitb3a2508f2ad79e2f1007464da7dbe918933038a0
tree6de13845c2cd8ba8d5c5e8f286b62f6ac08ac9a8
parent4a9d46dafb32b02099e0d790c583876f412ac1c1
s4/libnet: Fix joining a Windows pre-2008R2 DC

From v4.8 onwards, Samba may not be able join a DC older than 2008R2
because the Windows DC doesn't support GET_TGT.

If the dsdb repl_md code can't resolve a link target it returns an
error, and the calling code (e.g. drs_util.py) should retry with
GET_TGT. However, GET_TGT is only supported on Windows 2008R2 and later,
so if you try to join an earlier Windows DC, the join will throw an
error that you can't work-around.

We can avoid this problem by setting the same DSDB flag that GET_TGT
sets to indicate that the link targets are as up-to-date as possible,
and so there's no point retrying. Missing targets are still logged, so
this at least allows the admin to fix up any problems after the join
completed.

I've only done this for the join case (problems during periodic
replication are probably still worth escalating to an error).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14021
RN: From Samba v4.8 onwards, joining a Windows 2003 or 2008 (non-R2) AD
DC may not have worked. When this problem occurred, the following
message would be displayed:
 'Failed to commit objects: DOS code 0x000021bf'
This particular issue has now been resolved. Note that there may still
be other potential problems that occur when joining an older Windows DC.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/libnet/libnet_vampire.c