struct ldb_request *req;
const struct dsdb_schema *schema;
+ struct GUID our_invocation_id;
/* the controls we pass down */
struct ldb_control **controls;
{
struct ldb_context *ldb;
struct replmd_replicated_request *ac;
+ const struct GUID *our_invocation_id;
ldb = ldb_module_get_ctx(module);
ldb_debug_set(ldb, LDB_DEBUG_FATAL,
"replmd_modify: no dsdb_schema loaded");
DEBUG(0,(__location__ ": %s\n", ldb_errstring(ldb)));
+ talloc_free(ac);
+ return NULL;
+ }
+
+ /* get our invocationId */
+ our_invocation_id = samdb_ntds_invocation_id(ldb);
+ if (!our_invocation_id) {
+ ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+ "replmd_add: unable to find invocationId\n");
+ talloc_free(ac);
return NULL;
}
+ ac->our_invocation_id = *our_invocation_id;
return ac;
}
struct GUID guid;
struct replPropertyMetaDataBlob nmd;
struct ldb_val nmd_value;
- const struct GUID *our_invocation_id;
/*
* The use of a time_t here seems odd, but as the NTTIME
return ret;
}
- /* get our invocationId */
- our_invocation_id = samdb_ntds_invocation_id(ldb);
- if (!our_invocation_id) {
- ldb_debug_set(ldb, LDB_DEBUG_ERROR,
- "replmd_add: unable to find invocationId\n");
- talloc_free(ac);
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
/* we have to copy the message as the caller might have it as a const */
msg = ldb_msg_copy_shallow(ac, req->op.add.message);
if (msg == NULL) {
}
if (sa->linkID != 0 && functional_level > DS_DOMAIN_FUNCTION_2000) {
- ret = replmd_add_fix_la(module, e, ac->seq_num, our_invocation_id, t, &guid, sa, req);
+ ret = replmd_add_fix_la(module, e, ac->seq_num, &ac->our_invocation_id, t, &guid, sa, req);
if (ret != LDB_SUCCESS) {
talloc_free(ac);
return ret;
} else {
m->originating_change_time = now;
}
- m->originating_invocation_id = *our_invocation_id;
+ m->originating_invocation_id = ac->our_invocation_id;
m->originating_usn = ac->seq_num;
m->local_usn = ac->seq_num;
ni++;
struct replUpToDateVectorBlob nuv;
struct ldb_val nuv_value;
struct ldb_message_element *nuv_el = NULL;
- const struct GUID *our_invocation_id;
struct ldb_message_element *orf_el = NULL;
struct repsFromToBlob nrf;
struct ldb_val *nrf_value = NULL;
ni++;
}
- /* get our invocation_id if we have one already attached to the ldb */
- our_invocation_id = samdb_ntds_invocation_id(ldb);
- if (our_invocation_id == NULL) {
- DEBUG(0, ("repl_meta_data: Could not find our own server's invocationID!\n"));
- return replmd_replicated_request_werror(ar, WERR_DS_DRA_INTERNAL_ERROR);
- }
-
/* merge in the source_dsa vector is available */
for (i=0; (ruv && i < ruv->count); i++) {
found = false;
- if (our_invocation_id &&
- GUID_equal(&ruv->cursors[i].source_dsa_invocation_id,
- our_invocation_id)) {
+ if (GUID_equal(&ruv->cursors[i].source_dsa_invocation_id,
+ &ar->our_invocation_id)) {
continue;
}