drs_utils: Add GET_TGT support to 'samba-tool drs replicate --local'
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 16 Jun 2017 00:54:32 +0000 (12:54 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 18 Aug 2017 04:07:12 +0000 (06:07 +0200)
commitf812c29d4000ef35fa5d7f6007606ca53c5ed37a
treef7b6e217b9d62512325640bfe16bf96e7ab671f0
parentf87332eb35638cc38f83c580d4623ab978088601
drs_utils: Add GET_TGT support to 'samba-tool drs replicate --local'

Update drs_Replicate.replicate() so it handles being passed the GET_TGT
flag (more_flags). To do this, we need to always use a v10 GetNCChanges
request (v8 and v10 are essentially the same except for the more_flags).

If the replicate_chunk() call into the C bindings throws an error, check
to see whether the error could be fixed by setting the GET_TGT flag, and
re-send the request if so.

Unfortunately because WERR_DS_DRA_RECYCLED_TARGET isn't documented with
the other AD error codes, I've left it hardcoded for now (Microsoft
should be fixing up their Docs).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12972
python/samba/drs_utils.py