diff options
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 72ffd0e21c..db2415b397 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -1,4 +1,4 @@ -/* +/* ldb database library Copyright (C) Simo Sorce 2004-2008 @@ -10,12 +10,12 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -349,7 +349,7 @@ static int replmd_add_backlink(struct ldb_module *module, const struct dsdb_sche /* * Callback for most write operations in this module: - * + * * notify the repl task that a object has changed. The notifies are * gathered up in the replmd_private structure then written to the * @REPLCHANGED object in each partition during the prepare_commit @@ -357,9 +357,9 @@ static int replmd_add_backlink(struct ldb_module *module, const struct dsdb_sche static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares) { int ret; - struct replmd_replicated_request *ac = + struct replmd_replicated_request *ac = talloc_get_type_abort(req->context, struct replmd_replicated_request); - struct replmd_private *replmd_private = + struct replmd_private *replmd_private = talloc_get_type_abort(ldb_module_get_private(ac->module), struct replmd_private); struct nc_entry *modified_partition; struct ldb_control *partition_ctrl; @@ -391,15 +391,15 @@ static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares) partition = talloc_get_type_abort(partition_ctrl->data, struct dsdb_control_current_partition); - + if (ac->seq_num > 0) { - for (modified_partition = replmd_private->ncs; modified_partition; + for (modified_partition = replmd_private->ncs; modified_partition; modified_partition = modified_partition->next) { if (ldb_dn_compare(modified_partition->dn, partition->dn) == 0) { break; } } - + if (modified_partition == NULL) { modified_partition = talloc_zero(replmd_private, struct nc_entry); if (!modified_partition) { @@ -427,7 +427,7 @@ static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares) if (ac->apply_mode) { talloc_free(ares); ac->index_current++; - + ret = replmd_replicated_apply_next(ac); if (ret != LDB_SUCCESS) { return ldb_module_done(ac->req, NULL, NULL, ret); @@ -438,7 +438,7 @@ static int replmd_op_callback(struct ldb_request *req, struct ldb_reply *ares) * common path. Other cases will have it cleaned up * eventually with the ares */ talloc_free(partition_ctrl); - return ldb_module_done(ac->req, + return ldb_module_done(ac->req, controls_except_specified(controls, ares, partition_ctrl), ares->response, LDB_SUCCESS); } @@ -602,10 +602,10 @@ static int replmd_replPropertyMetaDataCtr1_sort(struct replPropertyMetaDataCtr1 rdn_sa = dsdb_attribute_by_lDAPDisplayName(schema, rdn_name); if (rdn_sa == NULL) { DEBUG(0,(__location__ ": No sa found for rDN %s for %s\n", rdn_name, ldb_dn_get_linearized(dn))); - return LDB_ERR_OPERATIONS_ERROR; + return LDB_ERR_OPERATIONS_ERROR; } - DEBUG(6,("Sorting rpmd with attid exception %u rDN=%s DN=%s\n", + DEBUG(6,("Sorting rpmd with attid exception %u rDN=%s DN=%s\n", rdn_sa->attributeID_id, rdn_name, ldb_dn_get_linearized(dn))); LDB_TYPESAFE_QSORT(ctr1->array, ctr1->count, &rdn_sa->attributeID_id, replmd_replPropertyMetaData1_attid_sort); @@ -620,7 +620,7 @@ static int replmd_ldb_message_element_attid_sort(const struct ldb_message_elemen const struct dsdb_attribute *a1; const struct dsdb_attribute *a2; - /* + /* * TODO: make this faster by caching the dsdb_attribute pointer * on the ldb_messag_element */ @@ -775,7 +775,7 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req) talloc_free(ac); return LDB_ERR_UNWILLING_TO_PERFORM; } - /* we remove this attribute as it can be a string and will not be treated + /* we remove this attribute as it can be a string and will not be treated correctly and then we will readd it latter on in the good format*/ remove_current_guid = true; } @@ -820,7 +820,7 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req) ldb_msg_remove_attr(msg,"objectGUID"); } - /* + /* * remove autogenerated attributes */ ldb_msg_remove_attr(msg, "whenCreated"); @@ -910,7 +910,7 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req) } /* generated NDR encoded values */ - ndr_err = ndr_push_struct_blob(&nmd_value, msg, + ndr_err = ndr_push_struct_blob(&nmd_value, msg, &nmd, (ndr_push_flags_fn_t)ndr_push_replPropertyMetaDataBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -1036,7 +1036,7 @@ static int replmd_update_rpmd_element(struct ldb_context *ldb, if (i == omd->ctr.ctr1.count) { /* we need to add a new one */ - omd->ctr.ctr1.array = talloc_realloc(msg, omd->ctr.ctr1.array, + omd->ctr.ctr1.array = talloc_realloc(msg, omd->ctr.ctr1.array, struct replPropertyMetaData1, omd->ctr.ctr1.count+1); if (omd->ctr.ctr1.array == NULL) { ldb_oom(ldb); @@ -1048,7 +1048,7 @@ static int replmd_update_rpmd_element(struct ldb_context *ldb, /* Get a new sequence number from the backend. We only do this * if we have a change that requires a new - * replPropertyMetaData element + * replPropertyMetaData element */ if (*seq_num == 0) { int ret = ldb_sequence_number(ldb, LDB_SEQ_NEXT, seq_num); @@ -1064,17 +1064,17 @@ static int replmd_update_rpmd_element(struct ldb_context *ldb, md1->originating_invocation_id = *our_invocation_id; md1->originating_usn = *seq_num; md1->local_usn = *seq_num; - + return LDB_SUCCESS; } /* * update the replPropertyMetaData object each time we modify an * object. This is needed for DRS replication, as the merge on the - * client is based on this object + * client is based on this object */ -static int replmd_update_rpmd(struct ldb_module *module, - const struct dsdb_schema *schema, +static int replmd_update_rpmd(struct ldb_module *module, + const struct dsdb_schema *schema, struct ldb_request *req, struct ldb_message *msg, uint64_t *seq_num, time_t t, @@ -1224,7 +1224,7 @@ static int replmd_update_rpmd(struct ldb_module *module, el->values = md_value; } - return LDB_SUCCESS; + return LDB_SUCCESS; } struct parsed_dn { @@ -1588,7 +1588,7 @@ static int replmd_modify_la_add(struct ldb_module *module, talloc_free(tmp_ctx); return LDB_ERR_OPERATIONS_ERROR; } - + ret = replmd_check_upgrade_links(old_dns, old_num_values, old_el, invocation_id); if (ret != LDB_SUCCESS) { talloc_free(tmp_ctx); @@ -2247,7 +2247,7 @@ static int replmd_rename_callback(struct ldb_request *req, struct ldb_reply *are talloc_free(ac); return ret; } - + if (add_uint64_element(msg, "uSNChanged", ac->seq_num) != LDB_SUCCESS) { talloc_free(ac); return ret; @@ -2380,7 +2380,7 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req) ldb_oom(ldb); return LDB_ERR_OPERATIONS_ERROR; } - + schema = dsdb_get_schema(ldb, tmp_ctx); if (!schema) { return LDB_ERR_OPERATIONS_ERROR; @@ -2590,7 +2590,7 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req) continue; } if (sa->linkID && sa->linkID & 1) { - ret = replmd_delete_remove_link(module, schema, old_dn, el, sa); + ret = replmd_delete_remove_link(module, schema, old_dn, el, sa); if (ret != LDB_SUCCESS) { talloc_free(tmp_ctx); return LDB_ERR_OPERATIONS_ERROR; @@ -2738,7 +2738,7 @@ static int replmd_replicated_apply_add(struct replmd_replicated_request *ar) continue; } } - + /* * the meta data array is already sorted by the caller */ @@ -3242,7 +3242,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a if (ruv->cursors[i].highest_usn > nuv.ctr.ctr2.cursors[j].highest_usn) { nuv.ctr.ctr2.cursors[j].highest_usn = ruv->cursors[i].highest_usn; } - break; + break; } if (found) continue; @@ -3357,7 +3357,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a /* * we compare the source dsa objectGUID not the invocation_id * because we want only one repsFrom value per source dsa - * and when the invocation_id of the source dsa has changed we don't need + * and when the invocation_id of the source dsa has changed we don't need * the old repsFrom with the old invocation_id */ if (!GUID_equal(&trf->ctr.ctr1.source_dsa_obj_guid, @@ -3393,7 +3393,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a } /* we now fill the value which is already attached to ldb_message */ - ndr_err = ndr_push_struct_blob(nrf_value, msg, + ndr_err = ndr_push_struct_blob(nrf_value, msg, &nrf, (ndr_push_flags_fn_t)ndr_push_repsFromToBlob); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { @@ -3401,7 +3401,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a return replmd_replicated_request_werror(ar, ntstatus_to_werror(nt_status)); } - /* + /* * the ldb_message_element for the attribute, has all the old values and the new one * so we'll replace the whole attribute with all values */ @@ -3509,7 +3509,7 @@ static int replmd_extended_replicated_objects(struct ldb_module *module, struct struct ldb_control **ctrls; int ret; uint32_t i; - struct replmd_private *replmd_private = + struct replmd_private *replmd_private = talloc_get_type(ldb_module_get_private(module), struct replmd_private); ldb = ldb_module_get_ctx(module); @@ -3598,7 +3598,7 @@ static int replmd_extended_replicated_objects(struct ldb_module *module, struct */ static int replmd_process_linked_attribute(struct ldb_module *module, struct la_entry *la_entry) -{ +{ struct drsuapi_DsReplicaLinkedAttribute *la = la_entry->la; struct ldb_context *ldb = ldb_module_get_ctx(module); struct ldb_message *msg; @@ -3620,40 +3620,40 @@ static int replmd_process_linked_attribute(struct ldb_module *module, const struct GUID *our_invocation_id; /* -linked_attributes[0]: - &objs->linked_attributes[i]: struct drsuapi_DsReplicaLinkedAttribute - identifier : * - identifier: struct drsuapi_DsReplicaObjectIdentifier - __ndr_size : 0x0000003a (58) - __ndr_size_sid : 0x00000000 (0) +linked_attributes[0]: + &objs->linked_attributes[i]: struct drsuapi_DsReplicaLinkedAttribute + identifier : * + identifier: struct drsuapi_DsReplicaObjectIdentifier + __ndr_size : 0x0000003a (58) + __ndr_size_sid : 0x00000000 (0) guid : 8e95b6a9-13dd-4158-89db-3220a5be5cc7 - sid : S-0-0 - __ndr_size_dn : 0x00000000 (0) - dn : '' - attid : DRSUAPI_ATTRIBUTE_member (0x1F) - value: struct drsuapi_DsAttributeValue - __ndr_size : 0x0000007e (126) - blob : * - blob : DATA_BLOB length=126 - flags : 0x00000001 (1) - 1: DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE - originating_add_time : Wed Sep 2 22:20:01 2009 EST - meta_data: struct drsuapi_DsReplicaMetaData - version : 0x00000015 (21) - originating_change_time : Wed Sep 2 23:39:07 2009 EST - originating_invocation_id: 794640f3-18cf-40ee-a211-a93992b67a64 - originating_usn : 0x000000000001e19c (123292) + sid : S-0-0 + __ndr_size_dn : 0x00000000 (0) + dn : '' + attid : DRSUAPI_ATTRIBUTE_member (0x1F) + value: struct drsuapi_DsAttributeValue + __ndr_size : 0x0000007e (126) + blob : * + blob : DATA_BLOB length=126 + flags : 0x00000001 (1) + 1: DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE + originating_add_time : Wed Sep 2 22:20:01 2009 EST + meta_data: struct drsuapi_DsReplicaMetaData + version : 0x00000015 (21) + originating_change_time : Wed Sep 2 23:39:07 2009 EST + originating_invocation_id: 794640f3-18cf-40ee-a211-a93992b67a64 + originating_usn : 0x000000000001e19c (123292) (for cases where the link is to a normal DN) - &target: struct drsuapi_DsReplicaObjectIdentifier3 - __ndr_size : 0x0000007e (126) - __ndr_size_sid : 0x0000001c (28) - guid : 7639e594-db75-4086-b0d4-67890ae46031 + &target: struct drsuapi_DsReplicaObjectIdentifier3 + __ndr_size : 0x0000007e (126) + __ndr_size_sid : 0x0000001c (28) + guid : 7639e594-db75-4086-b0d4-67890ae46031 sid : S-1-5-21-2848215498-2472035911-1947525656-19924 - __ndr_size_dn : 0x00000022 (34) - dn : 'CN=UOne,OU=TestOU,DC=vsofs8,DC=com' + __ndr_size_dn : 0x00000022 (34) + dn : 'CN=UOne,OU=TestOU,DC=vsofs8,DC=com' */ - + /* find the attribute being modified */ attr = dsdb_attribute_by_attributeID_id(schema, la->attid); if (attr == NULL) { @@ -3868,10 +3868,10 @@ linked_attributes[0]: talloc_free(tmp_ctx); return ret; } - + talloc_free(tmp_ctx); - return ret; + return ret; } static int replmd_extended(struct ldb_module *module, struct ldb_request *req) @@ -3885,7 +3885,7 @@ static int replmd_extended(struct ldb_module *module, struct ldb_request *req) /* - we hook into the transaction operations to allow us to + we hook into the transaction operations to allow us to perform the linked attribute updates at the end of the whole transaction. This allows a forward linked attribute to be created before the object is created. During a vampire, w2k8 sends us linked @@ -3911,11 +3911,11 @@ static int replmd_start_transaction(struct ldb_module *module) /* on prepare commit we loop over our queued la_context structures and - apply each of them + apply each of them */ static int replmd_prepare_commit(struct ldb_module *module) { - struct replmd_private *replmd_private = + struct replmd_private *replmd_private = talloc_get_type(ldb_module_get_private(module), struct replmd_private); struct la_entry *la, *prev; struct la_backlink *bl; @@ -3951,13 +3951,13 @@ static int replmd_prepare_commit(struct ldb_module *module) if (ret != LDB_SUCCESS) { return ret; } - + return ldb_next_prepare_commit(module); } static int replmd_del_transaction(struct ldb_module *module) { - struct replmd_private *replmd_private = + struct replmd_private *replmd_private = talloc_get_type(ldb_module_get_private(module), struct replmd_private); replmd_txn_cleanup(replmd_private); |