diff options
author | Michael Adam <obnox@samba.org> | 2010-06-25 18:11:35 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-06-25 18:11:35 +0200 |
commit | 5641ee02fdbd768b90ca8de43ce2f14b007e4245 (patch) | |
tree | 007333fbb7cd82bf0b452b583babe3308390d6a0 /source3 | |
parent | a9bec6b779edd2feead5fae5cb25cf1f862eaaf2 (diff) | |
download | samba-5641ee02fdbd768b90ca8de43ce2f14b007e4245.tar.gz samba-5641ee02fdbd768b90ca8de43ce2f14b007e4245.tar.xz samba-5641ee02fdbd768b90ca8de43ce2f14b007e4245.zip |
s3:registry: add a function regdb_store_regdb_version()
Diffstat (limited to 'source3')
-rw-r--r-- | source3/registry/reg_backend_db.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 84faaf602d9..d250228d3c8 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -439,6 +439,27 @@ static int regdb_normalize_keynames_fn(struct db_record *rec, return 0; } +static WERROR regdb_store_regdb_version(uint32_t version) +{ + NTSTATUS status; + const char *version_keyname = "INFO/version"; + + if (!regdb) { + return WERR_CAN_NOT_COMPLETE; + } + + status = dbwrap_trans_store_int32(regdb, version_keyname, version); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1, ("regdb_init: error storing %s = %d: %s\n", + version_keyname, version, nt_errstr(status))); + return ntstatus_to_werror(status); + } else { + DEBUG(10, ("regdb_init: stored %s = %d\n", + version_keyname, version)); + return WERR_OK; + } +} + static WERROR regdb_upgrade_v1_to_v2(void) { TALLOC_CTX *mem_ctx; |