1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/source4
Tim Beale 44ca84166e replmd: Allow missing targets if GET_TGT has already been set
While running the selftests, I noticed a case where DC replication
unexpectedly sends a linked attribute for a deleted object (created in
the drs.ridalloc_exop tests). The problem is due to the
msDS-NC-Replica-Locations attribute, which is a (known) one-way link.
Because it is a one-way link, when the test demotes the DC and deletes
the link target, there is no backlink to delete the link from the source
object.

After much debate and head-scratching, we decided that there wasn't an
ideal way to resolve this problem. Any automated intervention could
potentially do the wrong thing, especially if the link spans partitions.
Running dbcheck will find this problem and is able to fix it (providing
the deleted object is still a tombstone). So the recommendation is to
run dbcheck on your DCs every 6 months (or more frequently if using a
lower tombstone lifetime setting).

However, it does highlight a problem with the current GET_TGT
implementation. If the tombstone object had been expunged and you
upgraded to 4.8, then you would be stuck - replication would fail
because the target object can't be resolved, even with GET_TGT, and
dbcheck would not be able to fix the hanging link. The solution is to
not fail the replication for an unknown target if GET_TGT has already
been set (i.e. the dsdb_repl_flags contains
DSDB_REPL_FLAG_TARGETS_UPTODATE).

It's debatable whether we should add a hanging link in this case or
ignore/drop the link. Some cases to consider:
- If you're talking to a DC that still sends all the links last, you
  could still get object deletion between processing the source object's
  links and sending the target (GET_TGT just restarts the replication
  cycle from scratch). Adding a hanging link in this case would be
  incorrect and would add spurious information to the DB.
- Suppose there's a bug in Samba that incorrectly results in an object
  disappearing. If other DCs then remove any links that pointed to that
  object, it makes recovering from the problem harder. However, simply
  ignoring the link shouldn't result in data loss, i.e. replication won't
  remove the existing link information from other DCs. Data loss in this
  case would only occur if a new DC were brought online, or if it were a
  new link that was affected.
Based on this, I think ignoring the link does the least harm.

This problem also highlights that we should really be using the same
logic in both the unknown target and the deleted target cases.
Combining the logic and moving it into a common
replmd_allow_missing_target() function fixes the problem. (This also has
the side-effect of fixing another logic flaw - in the deleted object
case we would unnecessarily retry with GET_TGT if the target object was
in another partition. This is pointless work, because GET_TGT won't
resolve the target).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12972
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-09-18 05:51:25 +02:00
..
auth s4:auth/ntlmssp: add support for using "winbind" as DC 2017-08-07 15:20:03 +02:00
build/pasn1
cldap_server s4: Add TALLOC_CTX * to register_server_service(). 2017-05-11 20:30:13 +02:00
client s4: cifsdd: Allocate the event context off NULL, not talloc_autofree_context(). 2017-05-13 16:50:13 +02:00
cluster
dns_server s4:bind_dlz: Try the 'binddns dir' first 2017-09-16 00:57:24 +02:00
dsdb replmd: Allow missing targets if GET_TGT has already been set 2017-09-18 05:51:25 +02:00
echo_server s4: Add TALLOC_CTX * to register_server_service(). 2017-05-11 20:30:13 +02:00
heimdal HEIMDAL: don't bother seeing q if not sent 2017-08-28 15:10:54 +02:00
heimdal_build strerror_r: provide XSI-compliant strerror_r 2017-06-13 18:38:14 +02:00
include lib: Remove global xfile.h includes 2016-11-20 06:23:19 +01:00
kdc mit-kdb: Fix NULL pointer check after malloc 2017-07-24 18:45:33 +02:00
ldap_server ldap: Run the LDAP server with the default (typically standard) process model 2017-07-02 17:35:20 +02:00
lib lib: talloc: Use the system <talloc.h> include. 2017-08-17 00:53:48 +02:00
libcli python: Fix bad type in conversion of NTSTATUS. 2017-09-06 11:35:18 +02:00
libnet debug: Add new debug class "drs_repl" for DRS replication processing 2017-09-07 06:56:27 +02:00
librpc Install dcerpc/__init__.py for all Python environments 2017-09-14 22:29:39 +02:00
nbt_server s4: Add TALLOC_CTX * to register_server_service(). 2017-05-11 20:30:13 +02:00
ntp_signd s4: Add TALLOC_CTX * to register_server_service(). 2017-05-11 20:30:13 +02:00
ntvfs s4:auth/unix_token: remove unused tevent_context from security_token_to_unix_token() 2017-06-26 08:47:15 +02:00
param source4/provision: fix talloc_steal on unallocated memory 2017-05-25 02:25:13 +02:00
rpc_server getncchanges.c: Support GET_TGT better with large numbers of links 2017-09-18 05:51:25 +02:00
script
scripting samba_upgradedns: When we setup the internal dns cleanup bind-dns dir 2017-09-16 00:57:25 +02:00
selftest python:samba: Use 'binddns dir' in samba-tool and samba_upgradedns 2017-09-05 23:58:20 +02:00
setup selftest: Add a test for @ATTRIBUTES and @INDEXLIST generation 2017-06-15 01:24:25 +02:00
smb_server s4:smb_server: avoid using gensec_update_ev() for the negotiate blob 2017-05-21 21:05:08 +02:00
smbd s4/smbd: set the process group. 2017-09-18 04:39:50 +02:00
torture replmd: Allow missing targets if GET_TGT has already been set 2017-09-18 05:51:25 +02:00
utils man pages: change http://samba.org to https://www.samba.org 2016-12-09 13:10:26 +01:00
web_server s4: Add TALLOC_CTX * to register_server_service(). 2017-05-11 20:30:13 +02:00
winbind s4: Add TALLOC_CTX * to register_server_service(). 2017-05-11 20:30:13 +02:00
wrepl_server s4: Add TALLOC_CTX * to register_server_service(). 2017-05-11 20:30:13 +02:00
.clang_complete
.valgrind_suppressions
wscript_build