diff options
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/repl_meta_data.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index a558a64999..49fca5f376 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -751,6 +751,7 @@ static int replmd_add_fix_la(struct ldb_module *module, struct ldb_message_eleme */ static int replmd_add(struct ldb_module *module, struct ldb_request *req) { + struct samldb_msds_intid_persistant *msds_intid_struct; struct ldb_context *ldb; struct ldb_control *control; struct replmd_replicated_request *ac; @@ -1053,7 +1054,14 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req) if (control) { control->critical = 0; } + if (ldb_dn_compare_base(ac->schema->base_dn, req->op.add.message->dn) != 0) { + /* Update the usn in the SAMLDB_MSDS_INTID_OPAQUE opaque */ + msds_intid_struct = (struct samldb_msds_intid_persistant *) ldb_get_opaque(ldb, SAMLDB_MSDS_INTID_OPAQUE); + if (msds_intid_struct) { + msds_intid_struct->usn = ac->seq_num; + } + } /* go on with the call chain */ return ldb_next_request(module, down_req); } @@ -2294,6 +2302,7 @@ static int replmd_modify_handle_linked_attribs(struct ldb_module *module, static int replmd_modify(struct ldb_module *module, struct ldb_request *req) { + struct samldb_msds_intid_persistant *msds_intid_struct; struct ldb_context *ldb; struct replmd_replicated_request *ac; struct ldb_request *down_req; @@ -2426,6 +2435,14 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req) } } + if (!ldb_dn_compare_base(ac->schema->base_dn, msg->dn)) { + /* Update the usn in the SAMLDB_MSDS_INTID_OPAQUE opaque */ + msds_intid_struct = (struct samldb_msds_intid_persistant *) ldb_get_opaque(ldb, SAMLDB_MSDS_INTID_OPAQUE); + if (msds_intid_struct) { + msds_intid_struct->usn = ac->seq_num; + } + } + /* go on with the call chain */ return ldb_next_request(module, down_req); } |