dsdb: Simplify replmd_op_possible_conflict_callback behaviour
authorAndrew Bartlett <abartlet@samba.org>
Sun, 27 Mar 2016 02:39:03 +0000 (15:39 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 6 Jun 2016 14:36:23 +0000 (16:36 +0200)
commit90581b261340f5b5c46a8e2641832ab21f83b094
tree228f04f9049982f7ffb35a451abce9a9efe356e6
parent8938f384b7aaeea5131eb854307787805b648f34
dsdb: Simplify replmd_op_possible_conflict_callback behaviour

The previous behaviour of this code was to overwrite the req->callback of the original, failed request.

This is a problem for many reasons - including that ldb_module_done() may already have been
called on that pointer.

The correct pattern is to create a new request, and to call ldb_module_done() on the parent
request (the one in ar->req) not in this one, in the error case.

We use the passed in new callback either as the callback to call on success, or
as the callback to the ADD request.  We overwrite it with replmd_op_name_modify_callback
in the rename remote case, as before, but no longer modify req->callback as
this will not be used again.

This is less tricky and a little simpler to follow, as we also remove the
now unused handling for RENAME, which is in a separate routine now

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c