diff options
author | Michael Adam <obnox@samba.org> | 2010-06-25 18:12:28 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-06-25 18:12:28 +0200 |
commit | 2f44dcc96b5a02379995c8ba6270ff8d89e56953 (patch) | |
tree | 084d6875d5c9650eabb519dd3e6e1a52e377206d /source3 | |
parent | 5641ee02fdbd768b90ca8de43ce2f14b007e4245 (diff) | |
download | samba-2f44dcc96b5a02379995c8ba6270ff8d89e56953.tar.gz samba-2f44dcc96b5a02379995c8ba6270ff8d89e56953.tar.bz2 samba-2f44dcc96b5a02379995c8ba6270ff8d89e56953.zip |
s3:registry: use regdb_store_regdb_version() in regdb_upgrade_v1_to_v2()
Diffstat (limited to 'source3')
-rw-r--r-- | source3/registry/reg_backend_db.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index d250228d3c..47f9590576 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -464,6 +464,7 @@ static WERROR regdb_upgrade_v1_to_v2(void) { TALLOC_CTX *mem_ctx; int rc; + WERROR werr; mem_ctx = talloc_stackframe(); if (mem_ctx == NULL) { @@ -473,7 +474,13 @@ static WERROR regdb_upgrade_v1_to_v2(void) rc = regdb->traverse(regdb, regdb_normalize_keynames_fn, mem_ctx); talloc_destroy(mem_ctx); - return (rc == -1 ? WERR_REG_IO_FAILURE : WERR_OK); + + if (rc == -1) { + return WERR_REG_IO_FAILURE; + } + + werr = regdb_store_regdb_version(REGVER_V2); + return werr; } /*********************************************************************** @@ -541,8 +548,6 @@ WERROR regdb_init(void) } if (vers_id == REGVER_V1) { - NTSTATUS status; - DEBUG(10, ("regdb_init: got registry db version %d, upgrading " "to version %d\n", REGVER_V1, REGVER_V2)); @@ -556,16 +561,6 @@ WERROR regdb_init(void) return werr; } - status = dbwrap_trans_store_int32(regdb, vstring, REGVER_V2); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(1, ("regdb_init: error storing %s = %d: %s\n", - vstring, REGVER_V2, nt_errstr(status))); - regdb->transaction_cancel(regdb); - return ntstatus_to_werror(status); - } else { - DEBUG(10, ("regdb_init: stored %s = %d\n", - vstring, REGVER_V2)); - } if (regdb->transaction_commit(regdb) != 0) { return WERR_REG_IO_FAILURE; } |