replmd: Split checking link attr target into new function
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 13 Jun 2017 22:51:59 +0000 (10:51 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 18 Aug 2017 04:07:11 +0000 (06:07 +0200)
commit04ce638a1f7166b3fe75b52efd0a522248196fd4
treef6396b719d58a32a336b24bc940745edb17dcdaa
parentd13e7b92f85e5623c5cf1309f13d59141dc7d888
replmd: Split checking link attr target into new function

We want to re-use this code to check that the linked attribute's target
object exists *before* we try to commit the transaction. This will allow
us to re-request the block with the GET_TGT flag set.

This splits checking the target object exists into a separate function.

Minor changes of note:
- the 'parent' argument was passed to replmd_process_linked_attribute()
  as NULL, so I've just replaced where it was used in the refactored code
  with NULL.
- I've tweaked the "Failed to find GUID" error message slightly to display
  the attribute ID rather than the attribute name (saves repeating
  lookups and/or passing extra arguments).
- Tweaked the replmd_deletion_state() logic - it only made sense to call
  it in the code block where we actually found the target

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
source4/dsdb/samdb/ldb_modules/repl_meta_data.c