From cf55f78c29deb2c60bf4bf8e6bf17d0b75112d11 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 25 Sep 2009 20:38:20 -0700 Subject: [PATCH] s4-dsdb: update replPropertyMetaData on linked attribute source attributes --- .../dsdb/samdb/ldb_modules/repl_meta_data.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index df5ae1a1c69..253596ddeac 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2080,6 +2080,7 @@ static int replmd_process_linked_attribute(struct ldb_module *module, int ret; const struct dsdb_attribute *attr; struct ldb_dn *target_dn; + uint64_t seq_num = 0; /* linked_attributes[0]: @@ -2186,6 +2187,28 @@ linked_attributes[0]: ret_el->values[0].data = (uint8_t *)ldb_dn_get_extended_linearized(tmp_ctx, target_dn, 1); ret_el->values[0].length = strlen((char *)ret_el->values[0].data); + ret = replmd_update_rpmd(module, msg, &seq_num); + if (ret != LDB_SUCCESS) { + talloc_free(tmp_ctx); + return ret; + } + + /* we only change whenChanged and uSNChanged if the seq_num + has changed */ + if (seq_num != 0) { + time_t t = time(NULL); + + if (add_time_element(msg, "whenChanged", t) != LDB_SUCCESS) { + talloc_free(tmp_ctx); + return LDB_ERR_OPERATIONS_ERROR; + } + + if (add_uint64_element(msg, "uSNChanged", seq_num) != LDB_SUCCESS) { + talloc_free(tmp_ctx); + return LDB_ERR_OPERATIONS_ERROR; + } + } + ret = ldb_build_mod_req(&mod_req, ldb, tmp_ctx, msg, NULL, -- 2.34.1