s4-drs: ensure we add a RMD_ADDTIME when upgrading a linked attribute
authorAndrew Tridgell <tridge@samba.org>
Fri, 10 Jun 2011 00:10:04 +0000 (10:10 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 10 Jun 2011 00:14:56 +0000 (10:14 +1000)
if the link was a w2k style, and we are upgrading it, then set the
RMD_ADDTIME to the current time

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 04311a4a9871d5b677530c2d0127f0e9e3a11ce0..9d2e5e2ac3bbcf2d0599d8671ba707825c09c403 100644 (file)
@@ -1643,7 +1643,8 @@ static int replmd_update_la_val(TALLOC_CTX *mem_ctx, struct ldb_val *v, struct d
        if (old_addtime == NULL) {
                old_addtime = &tval;
        }
-       if (dsdb_dn != old_dsdb_dn) {
+       if (dsdb_dn != old_dsdb_dn ||
+           ldb_dn_get_extended_component(dn, "RMD_ADDTIME") == NULL) {
                ret = ldb_dn_set_extended_component(dn, "RMD_ADDTIME", old_addtime);
                if (ret != LDB_SUCCESS) return ret;
        }