s4-dsdb: make sure 'whenChanged' is set on modify
authorAndrew Tridgell <tridge@samba.org>
Wed, 30 Dec 2009 09:05:02 +0000 (20:05 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 1 Jan 2010 21:16:56 +0000 (08:16 +1100)
We also should preserve (and then replace) whenChanged on delete

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index ab412942e97ec3e6d6ec12a05f72b0b51ba19e85..202b74e8b496171b5d071f514d168387e94606ab 100644 (file)
@@ -1939,6 +1939,9 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
+       ldb_msg_remove_attr(msg, "whenChanged");
+       ldb_msg_remove_attr(msg, "uSNChanged");
+
        ret = replmd_update_rpmd(module, ac->schema, msg, &ac->seq_num, t);
        if (ret != LDB_SUCCESS) {
                talloc_free(ac);
@@ -2205,7 +2208,7 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
                "oMSyntax", "proxiedObjectName", "name", "replPropertyMetaData", "sAMAccountName",
                "securityIdentifier", "sIDHistory", "subClassOf", "systemFlags", "trustPartner", "trustDirection",
                "trustType", "trustAttributes", "userAccountControl", "uSNChanged", "uSNCreated", "whenCreated",
-               NULL};
+               "whenChanged", NULL};
        uint32_t el_count = 0;
        int i;