The Samba-Bugzilla – Attachment 15897 Details for
Bug 14337
Samba doesn't include subref HEADS in DsGETNCChanges() causing Windows to set instanceType: 5
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP patches on top of v4-10-test
tmp410.diff.txt (text/plain), 22.24 KB, created by
Stefan Metzmacher
on 2020-04-06 10:26:32 UTC
(
hide
)
Description:
WIP patches on top of v4-10-test
Filename:
MIME Type:
Creator:
Stefan Metzmacher
Created:
2020-04-06 10:26:32 UTC
Size:
22.24 KB
patch
obsolete
>From df3f918f3e933e034309f21a47ea318bc29521f8 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Mon, 30 Mar 2020 12:08:23 +0200 >Subject: [PATCH 01/17] source4/rpc_server/drsuapi/getncchanges.c fix debug > >--- > source4/rpc_server/drsuapi/getncchanges.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c >index 9c6b9801d7f6..0347be38e4de 100644 >--- a/source4/rpc_server/drsuapi/getncchanges.c >+++ b/source4/rpc_server/drsuapi/getncchanges.c >@@ -3418,7 +3418,7 @@ allowed: > > DEBUG(8,(__location__ ": %s object %s\n", > new_objs ? "replicating" : "skipping send of", >- ldb_dn_get_linearized(msg->dn))); >+ ldb_dn_get_linearized(msg->dn))); // METZE > > getnc_state->total_links += (getnc_state->la_count - old_la_index); > >-- >2.17.1 > > >From 7b748b4515bc4aa16071d066ac569e890bdd1ba5 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 14:23:27 +0200 >Subject: [PATCH 02/17] OPTIMIZE source4/dsdb/samdb/ldb_modules/partition.c > scope check before ldb_dn_compare_base() > >--- > source4/dsdb/samdb/ldb_modules/partition.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c >index f66ccab1dd56..3ff7e324c86e 100644 >--- a/source4/dsdb/samdb/ldb_modules/partition.c >+++ b/source4/dsdb/samdb/ldb_modules/partition.c >@@ -867,9 +867,10 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > stop = true; > } > if (!match && >- (ldb_dn_compare_base(req->op.search.base, >- data->partitions[i]->ctrl->dn) == 0 && >- req->op.search.scope != LDB_SCOPE_BASE)) { >+ req->op.search.scope != LDB_SCOPE_BASE && >+ ldb_dn_compare_base(req->op.search.base, >+ data->partitions[i]->ctrl->dn) == 0) >+ { > match = true; > } > if (!match && >-- >2.17.1 > > >From f4a1be6e213873f5ab6dca41c5816d290e220367 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 13:44:00 +0200 >Subject: [PATCH 03/17] DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID > >--- > source4/dsdb/samdb/samdb.h | 6 ++++++ > source4/setup/schema_samba4.ldif | 1 + > 2 files changed, 7 insertions(+) > >diff --git a/source4/dsdb/samdb/samdb.h b/source4/dsdb/samdb/samdb.h >index b0fdfeb39672..ed4182b1364e 100644 >--- a/source4/dsdb/samdb/samdb.h >+++ b/source4/dsdb/samdb/samdb.h >@@ -221,6 +221,12 @@ struct dsdb_control_transaction_identifier { > struct GUID transaction_guid; > }; > >+/* >+ * Passed to the partition control in order to convert referals to real >+ * objects >+ */ >+#define DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID "1.3.6.1.4.1.7165.4.3.35" >+ > #define DSDB_EXTENDED_REPLICATED_OBJECTS_OID "1.3.6.1.4.1.7165.4.4.1" > struct dsdb_extended_replicated_object { > struct ldb_message *msg; >diff --git a/source4/setup/schema_samba4.ldif b/source4/setup/schema_samba4.ldif >index a84675843658..fb114878c2fb 100644 >--- a/source4/setup/schema_samba4.ldif >+++ b/source4/setup/schema_samba4.ldif >@@ -230,6 +230,7 @@ > #Allocated: DSDB_CONTROL_INVALID_NOT_IMPLEMENTED 1.3.6.1.4.1.7165.4.3.32 > #Allocated: DSDB_CONTROL_PASSWORD_ACL_VALIDATION_OID 1.3.6.1.4.1.7165.4.3.33 > #Allocated: DSDB_CONTROL_TRANSACTION_IDENTIFIER_OID 1.3.6.1.4.1.7165.4.3.34 >+#Allocated: DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID 1.3.6.1.4.1.7165.4.3.35 > > > # Extended 1.3.6.1.4.1.7165.4.4.x >-- >2.17.1 > > >From 9da8550e480297f6a069f2e503e8adf92d540972 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 14:36:41 +0200 >Subject: [PATCH 04/17] source4/dsdb/samdb/ldb_modules/partition.c > DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID > >--- > source4/dsdb/samdb/ldb_modules/partition.c | 73 +++++++++++++++++++++- > 1 file changed, 72 insertions(+), 1 deletion(-) > >diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c >index 3ff7e324c86e..eb11483e8d26 100644 >--- a/source4/dsdb/samdb/ldb_modules/partition.c >+++ b/source4/dsdb/samdb/ldb_modules/partition.c >@@ -43,6 +43,7 @@ struct partition_context { > struct part_request *part_req; > unsigned int num_requests; > unsigned int finished_requests; >+ bool force_base_search; > > const char **referrals; > }; >@@ -353,6 +354,9 @@ static int partition_prep_request(struct partition_context *ac, > req->op.search.base) != 0) { > req->op.search.base = partition->ctrl->dn; > } >+ if (ac->force_base_search) { >+ req->op.search.scope = LDB_SCOPE_BASE; >+ } > } > > } else { >@@ -763,7 +767,8 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > struct ldb_control *search_control = ldb_request_get_control(req, LDB_CONTROL_SEARCH_OPTIONS_OID); > struct ldb_control *domain_scope_control = ldb_request_get_control(req, LDB_CONTROL_DOMAIN_SCOPE_OID); > struct ldb_control *no_gc_control = ldb_request_get_control(req, DSDB_CONTROL_NO_GLOBAL_CATALOG); >- >+ struct ldb_control *repl_control = ldb_request_get_control(req, DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID); >+ int num_base_comp = 0; > struct ldb_search_options_control *search_options = NULL; > struct dsdb_partition *p; > unsigned int i, j; >@@ -793,6 +798,10 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > return ldb_oom(ldb_module_get_ctx(module)); > } > >+ if (repl_control != NULL && !ldb_save_controls(repl_control, req, &saved_controls)) { >+ return ldb_module_oom(module); >+ } >+ > /* if we aren't initialised yet go further */ > if (!data || !data->partitions) { > return ldb_next_request(module, req); >@@ -834,8 +843,11 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > return partition_send_all(module, ac, req); > } > >+ num_base_comp = ldb_dn_get_comp_num(req->op.search.base); >+ > for (i=0; data->partitions[i]; i++) { > bool match = false, stop = false; >+ bool force_base_search = false; > > if (data->partitions[i]->partial_replica && no_gc_control != NULL) { > if (ldb_dn_compare_base(data->partitions[i]->ctrl->dn, >@@ -879,6 +891,62 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > match = true; > stop = true; /* note that this relies on partition ordering */ > } >+ } else if (repl_control != NULL) { >+ /* >+ * Collect object required for outbound replication. >+ * We find the main partition and all direct subRefs. >+ */ >+ int num_part_comp = ldb_dn_get_comp_num(data->partitions[i]->ctrl->dn); >+ int diff; >+ int cmp; >+ >+ if (num_part_comp < num_base_comp) { >+ /* >+ * If the partition is above the base dn >+ * go on... >+ */ >+ // TODO break? >+ continue; >+ } >+ >+ diff = num_part_comp - num_base_comp; >+ if (req->op.search.scope == LDB_SCOPE_BASE) { >+ if (diff > 0) { >+ /* >+ * If the number of dn components >+ * doesn't match on a BASE search >+ * go on... >+ */ >+ continue; >+ } >+ } else if (diff > 1) { >+ /* >+ * If the partition is not directly >+ * below the base dn go on... >+ */ >+ // TODO break? >+ continue; >+ } >+ >+ cmp = ldb_dn_compare_base(req->op.search.base, >+ data->partitions[i]->ctrl->dn); >+ if (cmp != 0) { >+ /* >+ * The names doesn't match... >+ */ >+ continue; >+ } >+ >+ match = true; >+ if (diff == 1) { >+ /* >+ * We force a base search on >+ * the subRef objects >+ */ >+ force_base_search = true; >+ } >+ // ??? if (!force_base_search) stop = true; /* note that this relies on partition ordering */ >+ > } else { > /* Domain scope: Find all partitions under the search > * base. >@@ -958,7 +1026,10 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > } > > if (match) { >+ >+ ac->force_base_search = force_base_search; > ret = partition_prep_request(ac, data->partitions[i]); >+ ac->force_base_search = false; > if (ret != LDB_SUCCESS) { > return ret; > } >-- >2.17.1 > > >From 3a5d6ad459ae115ddd6331384f41bd0f82f8c129 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 13:44:15 +0200 >Subject: [PATCH 05/17] source4/rpc_server/drsuapi/getncchanges.c > GUID_equal(guid, &getnc_state->ncRoot_guid) > >--- > source4/rpc_server/drsuapi/getncchanges.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c >index 0347be38e4de..3cac4516d458 100644 >--- a/source4/rpc_server/drsuapi/getncchanges.c >+++ b/source4/rpc_server/drsuapi/getncchanges.c >@@ -511,7 +511,10 @@ static WERROR get_nc_changes_build_object(struct drsuapi_DsReplicaObjectListItem > > uSNChanged = ldb_msg_find_attr_as_uint64(msg, "uSNChanged", 0); > instanceType = ldb_msg_find_attr_as_uint(msg, "instanceType", 0); >- if (instanceType & INSTANCE_TYPE_IS_NC_HEAD) { >+ >+ if (instanceType & INSTANCE_TYPE_IS_NC_HEAD && >+ GUID_equal(guid, &getnc_state->ncRoot_guid)) >+ { > obj->is_nc_prefix = true; > obj->parent_object_guid = NULL; > } else { >-- >2.17.1 > > >From 61ba9732a0fac8f70c8f7ed10512645b0ecccf16 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 14:59:34 +0200 >Subject: [PATCH 06/17] source4/rpc_server/drsuapi/drsutil.c > drsuapi_search_with_extended_dn DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID > >--- > source4/rpc_server/drsuapi/drsutil.c | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/source4/rpc_server/drsuapi/drsutil.c b/source4/rpc_server/drsuapi/drsutil.c >index 7897c35d2e94..7a0e5cd517e3 100644 >--- a/source4/rpc_server/drsuapi/drsutil.c >+++ b/source4/rpc_server/drsuapi/drsutil.c >@@ -80,6 +80,13 @@ int drsuapi_search_with_extended_dn(struct ldb_context *ldb, > return ret; > } > >+ if (scope != LDB_SCOPE_BASE) { >+ ret = ldb_request_add_control(req, DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID, true, NULL); >+ if (ret != LDB_SUCCESS) { >+ return ret; >+ } >+ } >+ > ret = ldb_request(ldb, req); > if (ret == LDB_SUCCESS) { > ret = ldb_wait(req->handle, LDB_WAIT_ALL); >-- >2.17.1 > > >From 1473dbf48d394a545fb07acb5ebb70be1d8c9737 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 15:14:01 +0200 >Subject: [PATCH 07/17] source4/dsdb/samdb/ldb_modules/operational.c > construct_parent_guid generate_parent > >--- > source4/dsdb/samdb/ldb_modules/operational.c | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c >index 86e43e124afc..22308cf4cbf2 100644 >--- a/source4/dsdb/samdb/ldb_modules/operational.c >+++ b/source4/dsdb/samdb/ldb_modules/operational.c >@@ -356,6 +356,7 @@ static int construct_parent_guid(struct ldb_module *module, > int ret; > struct ldb_dn *parent_dn; > struct ldb_val v; >+ bool generate_parent = true; > > /* determine if the object is NC by instance type */ > ret = dsdb_module_search_dn(module, msg, &res, msg->dn, attrs, >@@ -369,6 +370,10 @@ static int construct_parent_guid(struct ldb_module *module, > "instanceType", 0); > talloc_free(res); > if (instanceType & INSTANCE_TYPE_IS_NC_HEAD) { >+ generate_parent = false; >+ } >+ >+ if (!generate_parent) { > DEBUG(4,(__location__ ": Object %s is NC\n", > ldb_dn_get_linearized(msg->dn))); > return LDB_SUCCESS; >-- >2.17.1 > > >From 99dc8f28d8f9195e0951d22b3d39abdef1c27e24 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 15:17:04 +0200 >Subject: [PATCH 08/17] source4/dsdb/samdb/ldb_modules/operational.c > construct_parent_guid DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID > >--- > source4/dsdb/samdb/ldb_modules/operational.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c >index 22308cf4cbf2..3f62de75fe8a 100644 >--- a/source4/dsdb/samdb/ldb_modules/operational.c >+++ b/source4/dsdb/samdb/ldb_modules/operational.c >@@ -348,6 +348,7 @@ static int construct_parent_guid(struct ldb_module *module, > struct ldb_message *msg, enum ldb_scope scope, > struct ldb_request *parent) > { >+ struct ldb_control *repl_control = NULL; > struct ldb_result *res, *parent_res; > const struct ldb_val *parent_guid; > const char *attrs[] = { "instanceType", NULL }; >@@ -373,6 +374,15 @@ static int construct_parent_guid(struct ldb_module *module, > generate_parent = false; > } > >+ if (parent != NULL) { >+ repl_control = ldb_request_get_control(parent, >+ DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID); >+ } >+ >+ if (repl_control != NULL && (instanceType & INSTANCE_TYPE_NC_ABOVE)) { >+ generate_parent = true; >+ } >+ > if (!generate_parent) { > DEBUG(4,(__location__ ": Object %s is NC\n", > ldb_dn_get_linearized(msg->dn))); >-- >2.17.1 > > >From b4675b802ace50a067f688734870444d3dc3a2d7 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 15:17:30 +0200 >Subject: [PATCH 09/17] sq source4/dsdb/samdb/ldb_modules/partition.c > partition_search DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID > >--- > source4/dsdb/samdb/ldb_modules/partition.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > >diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c >index eb11483e8d26..f5b6c7a4b363 100644 >--- a/source4/dsdb/samdb/ldb_modules/partition.c >+++ b/source4/dsdb/samdb/ldb_modules/partition.c >@@ -798,10 +798,6 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > return ldb_oom(ldb_module_get_ctx(module)); > } > >- if (repl_control != NULL && !ldb_save_controls(repl_control, req, &saved_controls)) { >- return ldb_module_oom(module); >- } >- > /* if we aren't initialised yet go further */ > if (!data || !data->partitions) { > return ldb_next_request(module, req); >@@ -843,7 +839,10 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) > return partition_send_all(module, ac, req); > } > >- num_base_comp = ldb_dn_get_comp_num(req->op.search.base); >+ if (repl_control != NULL) { >+ repl_control->critical = false; >+ num_base_comp = ldb_dn_get_comp_num(req->op.search.base); >+ } > > for (i=0; data->partitions[i]; i++) { > bool match = false, stop = false; >-- >2.17.1 > > >From 97d2574773386592d465817155f88840fdb24139 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 15:23:58 +0200 >Subject: [PATCH 10/17] Sq source4/rpc_server/drsuapi/drsutil.c > drsuapi_search_with_extended_dn always > DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID > >--- > source4/rpc_server/drsuapi/drsutil.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/rpc_server/drsuapi/drsutil.c b/source4/rpc_server/drsuapi/drsutil.c >index 7a0e5cd517e3..df35e78e0b30 100644 >--- a/source4/rpc_server/drsuapi/drsutil.c >+++ b/source4/rpc_server/drsuapi/drsutil.c >@@ -80,7 +80,7 @@ int drsuapi_search_with_extended_dn(struct ldb_context *ldb, > return ret; > } > >- if (scope != LDB_SCOPE_BASE) { >+ if (true || scope != LDB_SCOPE_BASE) { > ret = ldb_request_add_control(req, DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID, true, NULL); > if (ret != LDB_SUCCESS) { > return ret; >-- >2.17.1 > > >From 6685a36bd68d7e85d70f7e8b12e28f7b4be951ec Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 31 Mar 2020 15:25:30 +0200 >Subject: [PATCH 11/17] SQ TODO/FIX HEIMDAL:lib/krb5: add > krb5_rd_req_out_get_raw_ticket() > >--- > source4/heimdal/lib/krb5/rd_req.c | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/source4/heimdal/lib/krb5/rd_req.c b/source4/heimdal/lib/krb5/rd_req.c >index 326a71252a14..b5b637c59e1f 100644 >--- a/source4/heimdal/lib/krb5/rd_req.c >+++ b/source4/heimdal/lib/krb5/rd_req.c >@@ -886,11 +886,14 @@ krb5_rd_req_ctx(krb5_context context, > if (ret) > goto out; > >+if (0) { >+// TODO debug memory corruption > ret = encode_Ticket(o->raw_ticket.data, > o->raw_ticket.length, > &ap_req.ticket, &len); > if (ret) > goto out; >+} > > /* Save that principal that was in the request */ > ret = _krb5_principalname2krb5_principal(context, >-- >2.17.1 > > >From 62dca0f018f6435c99a1164d79c0a7df8641a0bf Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 1 Apr 2020 11:15:05 +0200 >Subject: [PATCH 12/17] TODO define DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID > >--- > source4/dsdb/samdb/samdb.h | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/source4/dsdb/samdb/samdb.h b/source4/dsdb/samdb/samdb.h >index ed4182b1364e..5f9956334cc3 100644 >--- a/source4/dsdb/samdb/samdb.h >+++ b/source4/dsdb/samdb/samdb.h >@@ -226,6 +226,7 @@ struct dsdb_control_transaction_identifier { > * objects > */ > #define DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID "1.3.6.1.4.1.7165.4.3.35" >+#define DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID "1.3.6.1.4.1.7165.4.3.36" > > #define DSDB_EXTENDED_REPLICATED_OBJECTS_OID "1.3.6.1.4.1.7165.4.4.1" > struct dsdb_extended_replicated_object { >-- >2.17.1 > > >From 6c777f444b5b8b19974ff572dc6e325c31f7c356 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 1 Apr 2020 11:15:20 +0200 >Subject: [PATCH 13/17] source4/dsdb/samdb/ldb_modules/operational.c > DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID > >--- > source4/dsdb/samdb/ldb_modules/operational.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c >index 3f62de75fe8a..d5b744431ec8 100644 >--- a/source4/dsdb/samdb/ldb_modules/operational.c >+++ b/source4/dsdb/samdb/ldb_modules/operational.c >@@ -376,7 +376,7 @@ static int construct_parent_guid(struct ldb_module *module, > > if (parent != NULL) { > repl_control = ldb_request_get_control(parent, >- DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID); >+ DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID);//DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID); > } > > if (repl_control != NULL && (instanceType & INSTANCE_TYPE_NC_ABOVE)) { >-- >2.17.1 > > >From 4017cad3419da56eeab6f22be21f43a8865f7dce Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 1 Apr 2020 11:15:34 +0200 >Subject: [PATCH 14/17] source4/rpc_server/drsuapi/drsutil.c > DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID > >--- > source4/rpc_server/drsuapi/drsutil.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/source4/rpc_server/drsuapi/drsutil.c b/source4/rpc_server/drsuapi/drsutil.c >index df35e78e0b30..a129d5142e8c 100644 >--- a/source4/rpc_server/drsuapi/drsutil.c >+++ b/source4/rpc_server/drsuapi/drsutil.c >@@ -80,12 +80,18 @@ int drsuapi_search_with_extended_dn(struct ldb_context *ldb, > return ret; > } > >- if (true || scope != LDB_SCOPE_BASE) { >+ if (scope != LDB_SCOPE_BASE) { > ret = ldb_request_add_control(req, DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID, true, NULL); > if (ret != LDB_SUCCESS) { > return ret; > } > } >+ if (scope == LDB_SCOPE_BASE) { >+ ret = ldb_request_add_control(req, DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID, true, NULL); >+ if (ret != LDB_SUCCESS) { >+ return ret; >+ } >+ } > > ret = ldb_request(ldb, req); > if (ret == LDB_SUCCESS) { >-- >2.17.1 > > >From 5be0aba86b2bb94858b84dc7672be4df2623bbe4 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 1 Apr 2020 11:20:55 +0200 >Subject: [PATCH 15/17] sq source4/dsdb/samdb/ldb_modules/operational.c > DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID > >--- > source4/dsdb/samdb/ldb_modules/operational.c | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c >index d5b744431ec8..72e69cfec549 100644 >--- a/source4/dsdb/samdb/ldb_modules/operational.c >+++ b/source4/dsdb/samdb/ldb_modules/operational.c >@@ -377,6 +377,9 @@ static int construct_parent_guid(struct ldb_module *module, > if (parent != NULL) { > repl_control = ldb_request_get_control(parent, > DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID);//DSDB_CONTROL_COLLECT_REPLICATION_CHANGES_OID); >+ if (repl_control != NULL) { >+ repl_control->critical = false; >+ } > } > > if (repl_control != NULL && (instanceType & INSTANCE_TYPE_NC_ABOVE)) { >-- >2.17.1 > > >From c4e107aebb0b944be6ab77b71041f2f98617bf2b Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 1 Apr 2020 11:23:05 +0200 >Subject: [PATCH 16/17] source4/rpc_server/drsuapi/drsutil.c > drsuapi_search_with_extended_dn DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID > >--- > source4/rpc_server/drsuapi/drsutil.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/rpc_server/drsuapi/drsutil.c b/source4/rpc_server/drsuapi/drsutil.c >index a129d5142e8c..126af825863d 100644 >--- a/source4/rpc_server/drsuapi/drsutil.c >+++ b/source4/rpc_server/drsuapi/drsutil.c >@@ -87,7 +87,7 @@ int drsuapi_search_with_extended_dn(struct ldb_context *ldb, > } > } > if (scope == LDB_SCOPE_BASE) { >- ret = ldb_request_add_control(req, DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID, true, NULL); >+ ret = ldb_request_add_control(req, DSDB_CONTROL_FETCH_REPLICATION_OBJECT_OID, false, NULL); > if (ret != LDB_SUCCESS) { > return ret; > } >-- >2.17.1 > > >From 0428b5d320656cc5e3f059033f1621551f7cb258 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 1 Apr 2020 11:33:32 +0200 >Subject: [PATCH 17/17] source4/rpc_server/drsuapi/getncchanges.c > get_link_identifier > >--- > source4/rpc_server/drsuapi/getncchanges.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c >index 3cac4516d458..8c60451d607a 100644 >--- a/source4/rpc_server/drsuapi/getncchanges.c >+++ b/source4/rpc_server/drsuapi/getncchanges.c >@@ -151,6 +151,22 @@ static struct drsuapi_DsReplicaObjectIdentifier *get_object_identifier(TALLOC_CT > return identifier; > } > >+static struct drsuapi_DsReplicaObjectIdentifier *get_link_identifier(TALLOC_CTX *mem_ctx, >+ const struct ldb_message *msg) >+{ >+ struct drsuapi_DsReplicaObjectIdentifier *identifier; >+ >+ identifier = talloc_zero(mem_ctx, struct drsuapi_DsReplicaObjectIdentifier); >+ if (identifier == NULL) { >+ return NULL; >+ } >+ >+ identifier->dn = ""; >+ identifier->guid = samdb_result_guid(msg, "objectGUID"); >+ >+ return identifier; >+} >+ > static int udv_compare(const struct GUID *guid1, struct GUID guid2) > { > return GUID_compare(guid1, &guid2); >@@ -772,7 +788,7 @@ static WERROR get_nc_changes_add_la(TALLOC_CTX *mem_ctx, > > la = &(*la_list)[*la_count]; > >- la->identifier = get_object_identifier(*la_list, msg); >+ la->identifier = get_link_identifier(*la_list, msg); > W_ERROR_HAVE_NO_MEMORY(la->identifier); > > active = (dsdb_dn_rmd_flags(dsdb_dn->dn) & DSDB_RMD_FLAG_DELETED) == 0; >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14337
: 15897