s4-drs: fixed updating of uSNChanged in replmd_modify
authorAndrew Tridgell <tridge@samba.org>
Wed, 2 Dec 2009 06:14:40 +0000 (17:14 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 2 Dec 2009 23:27:59 +0000 (10:27 +1100)
Updating of uSNChanged broke in a recent change

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index bfde2df1d167673e18ccc595a4a9b2834e9296be..9ed70d96eb823c64a9885d099c27fedd38e02659 100644 (file)
@@ -837,7 +837,6 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
        struct ldb_message *msg;
        struct ldb_result *res;
        time_t t = time(NULL);
-       uint64_t seq_num = 0;
        int ret;
 
        /* do not manipulate our control entries */
@@ -900,13 +899,13 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
 
        /* we only change whenChanged and uSNChanged if the seq_num
           has changed */
-       if (seq_num != 0) {
+       if (ac->seq_num != 0) {
                if (add_time_element(msg, "whenChanged", t) != LDB_SUCCESS) {
                        talloc_free(ac);
                        return ret;
                }
 
-               if (add_uint64_element(msg, "uSNChanged", seq_num) != LDB_SUCCESS) {
+               if (add_uint64_element(msg, "uSNChanged", ac->seq_num) != LDB_SUCCESS) {
                        talloc_free(ac);
                        return ret;
                }