getncchanges: use the uptodateness_vector to filter links to replicate
authorGarming Sam <garming@catalyst.net.nz>
Wed, 14 Dec 2016 03:05:05 +0000 (16:05 +1300)
committerGarming Sam <garming@samba.org>
Wed, 21 Dec 2016 03:37:54 +0000 (04:37 +0100)
This is to mirror the check in get_nc_changes_build_object.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Dec 21 04:37:54 CET 2016 on sn-devel-144

selftest/knownfail
source4/rpc_server/drsuapi/getncchanges.c

index b9b0b9a455c10ad6535986845dc4056143cfc07f..d96e238796c34521e60fb3b386f5ae0f6175f5ec 100644 (file)
 ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_add_duplicate_different_type.*
 ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_rank_none.*
 ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_security_descriptor.*
-# uptodateness_vector isn't check when determining which linked attributes to replicate
-^samba4.drs.getnc_exop.python.*getnc_exop.DrsReplicaSyncTestCase.test_link_utdv_hwm.*
index 70ec04c23172bbf75ee3c9f88123a847940ffcfb..705c8cfd89fbe2d4407e2d205b798c02c589c768 100644 (file)
@@ -605,8 +605,10 @@ static WERROR get_nc_changes_add_links(struct ldb_context *sam_ctx,
                for (j=0; j<el->num_values; j++) {
                        struct dsdb_dn *dsdb_dn;
                        uint64_t local_usn;
-                       NTSTATUS status;
+                       uint64_t originating_usn;
+                       NTSTATUS status, status2;
                        WERROR werr;
+                       struct GUID originating_invocation_id;
 
                        dsdb_dn = dsdb_dn_parse(tmp_ctx, sam_ctx, &el->values[j], sa->syntax->ldap_oid);
                        if (dsdb_dn == NULL) {
@@ -635,6 +637,21 @@ static WERROR get_nc_changes_add_links(struct ldb_context *sam_ctx,
                                continue;
                        }
 
+                       status = dsdb_get_extended_dn_guid(dsdb_dn->dn,
+                                                          &originating_invocation_id,
+                                                          "RMD_INVOCID");
+                       status2 = dsdb_get_extended_dn_uint64(dsdb_dn->dn,
+                                                             &originating_usn,
+                                                             "RMD_ORIGINATING_USN");
+
+                       if (NT_STATUS_IS_OK(status) && NT_STATUS_IS_OK(status2)) {
+                               if (udv_filter(uptodateness_vector,
+                                              &originating_invocation_id,
+                                              originating_usn)) {
+                                       continue;
+                               }
+                       }
+
                        werr = get_nc_changes_add_la(mem_ctx, sam_ctx, schema,
                                                     sa, msg, dsdb_dn, la_list,
                                                     la_count, is_schema_nc);