The branch, master has been updated via dfbffac s3:registry: fix a debug message typo via fff30e9 s3:registry: introduce a define REGDB_CODE_VERSION and use it in regdb code. via 39c6de2 s3:registry: rename REGVE_Vx toREGDB_VERSION_Vx for consistency from e579c84 s3:registry: implement regdb_set_secdesc() with regdb_trans_do()
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit dfbffac9777afb021997fb082601181cb516dc13 Author: Michael Adam <ob...@samba.org> Date: Fri Sep 2 00:36:21 2011 +0200 s3:registry: fix a debug message typo Autobuild-User: Michael Adam <ob...@samba.org> Autobuild-Date: Fri Sep 2 11:47:11 CEST 2011 on sn-devel-104 commit fff30e9f88f404bf3521f892e325222b2e8773aa Author: Michael Adam <ob...@samba.org> Date: Fri Sep 2 00:34:12 2011 +0200 s3:registry: introduce a define REGDB_CODE_VERSION and use it in regdb code. This is to not use the precise code version REGDB_VERSION_V3 explicitly in the code. commit 39c6de28fa5bdbd32c465a08e589deee3ee2c074 Author: Michael Adam <ob...@samba.org> Date: Fri Sep 2 00:07:58 2011 +0200 s3:registry: rename REGVE_Vx toREGDB_VERSION_Vx for consistency ----------------------------------------------------------------------- Summary of changes: source3/registry/reg_backend_db.c | 34 ++++++++++++++++------------------ source3/registry/reg_db.h | 10 ++++++---- 2 files changed, 22 insertions(+), 22 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 0218f05..88e234e 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -73,11 +73,11 @@ static NTSTATUS regdb_trans_do_action(struct db_context *db, void *private_data) version_id = dbwrap_fetch_int32(db, REGDB_VERSION_KEYNAME); - if (version_id != REGVER_V3) { + if (version_id != REGDB_CODE_VERSION) { DEBUG(0, ("ERROR: changed registry version %d found while " "trying to write to the registry. Version %d " "expected. Denying access.\n", - version_id, REGVER_V3)); + version_id, REGDB_CODE_VERSION)); return NT_STATUS_ACCESS_DENIED; } @@ -501,7 +501,7 @@ static WERROR regdb_upgrade_v1_to_v2(struct db_context *db) return WERR_REG_IO_FAILURE; } - werr = regdb_store_regdb_version(db, REGVER_V2); + werr = regdb_store_regdb_version(db, REGDB_VERSION_V2); return werr; } @@ -606,7 +606,7 @@ static WERROR regdb_upgrade_v2_to_v3(struct db_context *db) goto done; } - werr = regdb_store_regdb_version(db, REGVER_V3); + werr = regdb_store_regdb_version(db, REGDB_VERSION_V3); done: return werr; @@ -618,7 +618,7 @@ done: WERROR regdb_init(void) { - uint32 vers_id, expected_version; + uint32 vers_id; WERROR werr; if (regdb) { @@ -647,22 +647,20 @@ WERROR regdb_init(void) DEBUG(10, ("regdb_init: registry db openend. refcount reset (%d)\n", regdb_refcount)); - expected_version = REGVER_V3; - vers_id = dbwrap_fetch_int32(regdb, REGDB_VERSION_KEYNAME); if (vers_id == -1) { DEBUG(10, ("regdb_init: registry version uninitialized " "(got %d), initializing to version %d\n", - vers_id, expected_version)); + vers_id, REGDB_CODE_VERSION)); - werr = regdb_store_regdb_version(regdb, expected_version); + werr = regdb_store_regdb_version(regdb, REGDB_CODE_VERSION); return werr; } - if (vers_id > expected_version || vers_id == 0) { + if (vers_id > REGDB_CODE_VERSION || vers_id == 0) { DEBUG(0, ("regdb_init: unknown registry version %d " "(code version = %d), refusing initialization\n", - vers_id, expected_version)); + vers_id, REGDB_CODE_VERSION)); return WERR_CAN_NOT_COMPLETE; } @@ -670,9 +668,9 @@ WERROR regdb_init(void) return WERR_REG_IO_FAILURE; } - if (vers_id == REGVER_V1) { - DEBUG(10, ("regdb_init: upgrading registry fromversion %d " - "to %d\n", REGVER_V1, REGVER_V2)); + if (vers_id == REGDB_VERSION_V1) { + DEBUG(10, ("regdb_init: upgrading registry from version %d " + "to %d\n", REGDB_VERSION_V1, REGDB_VERSION_V2)); werr = regdb_upgrade_v1_to_v2(regdb); if (!W_ERROR_IS_OK(werr)) { @@ -680,12 +678,12 @@ WERROR regdb_init(void) return werr; } - vers_id = REGVER_V2; + vers_id = REGDB_VERSION_V2; } - if (vers_id == REGVER_V2) { + if (vers_id == REGDB_VERSION_V2) { DEBUG(10, ("regdb_init: upgrading registry from version %d " - "to %d\n", REGVER_V2, REGVER_V3)); + "to %d\n", REGDB_VERSION_V2, REGDB_VERSION_V3)); werr = regdb_upgrade_v2_to_v3(regdb); if (!W_ERROR_IS_OK(werr)) { @@ -693,7 +691,7 @@ WERROR regdb_init(void) return werr; } - vers_id = REGVER_V3; + vers_id = REGDB_VERSION_V3; } /* future upgrade code should go here */ diff --git a/source3/registry/reg_db.h b/source3/registry/reg_db.h index b77e45a..d0d9fd3 100644 --- a/source3/registry/reg_db.h +++ b/source3/registry/reg_db.h @@ -22,10 +22,12 @@ #define REG_TDB_FLAGS TDB_SEQNUM -#define REGVER_V1 1 /* first db version with write support */ -#define REGVER_V2 2 /* version 2 with normalized keys */ -#define REGVER_V3 3 /* different definition of key existence, */ - /* sorted subkeys cache removed. */ +#define REGDB_VERSION_V1 1 /* first db version with write support */ +#define REGDB_VERSION_V2 2 /* version 2 with normalized keys */ +#define REGDB_VERSION_V3 3 /* different definition of key existence, */ + /* sorted subkeys cache removed. */ + +#define REGDB_CODE_VERSION REGDB_VERSION_V3 #define REG_VALUE_PREFIX "SAMBA_REGVAL" #define REG_SECDESC_PREFIX "SAMBA_SECDESC" -- Samba Shared Repository