summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-25 20:38:20 -0700
committerAndrew Tridgell <tridge@samba.org>2009-09-28 10:25:17 +1000
commitcf55f78c29deb2c60bf4bf8e6bf17d0b75112d11 (patch)
tree6b271369aea20ecd80a2efeda066e7045c1c606d /source4/dsdb/samdb/ldb_modules
parent83fae5f23f3a7929a685bf4e92bb99191bb2abe3 (diff)
downloadsamba-cf55f78c29deb2c60bf4bf8e6bf17d0b75112d11.tar.gz
samba-cf55f78c29deb2c60bf4bf8e6bf17d0b75112d11.tar.bz2
samba-cf55f78c29deb2c60bf4bf8e6bf17d0b75112d11.zip
s4-dsdb: update replPropertyMetaData on linked attribute source attributes
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c23
1 files changed, 23 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 df5ae1a1c6..253596ddea 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,