From 658f72128ff6950c6a03994198b4464a273fb300 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 6 Oct 2011 21:07:27 +0200 Subject: s3:dbwrap: change dbwrap_fetch_uint32() to NTSTATUS return type (instead of bool) for consistency and better error propagation --- source3/passdb/account_pol.c | 14 ++++++++------ source3/passdb/pdb_tdb.c | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'source3/passdb') diff --git a/source3/passdb/account_pol.c b/source3/passdb/account_pol.c index dd495082a2..bd8cdf725f 100644 --- a/source3/passdb/account_pol.c +++ b/source3/passdb/account_pol.c @@ -213,7 +213,7 @@ bool init_account_policy(void) const char *vstring = "INFO/version"; uint32_t version = 0; int i; - bool ret; + NTSTATUS status; if (db != NULL) { return True; @@ -232,8 +232,8 @@ bool init_account_policy(void) } } - ret = dbwrap_fetch_uint32(db, vstring, &version); - if (!ret) { + status = dbwrap_fetch_uint32(db, vstring, &version); + if (!NT_STATUS_IS_OK(status)) { version = 0; } @@ -249,8 +249,8 @@ bool init_account_policy(void) return false; } - ret = dbwrap_fetch_uint32(db, vstring, &version); - if (!ret) { + status = dbwrap_fetch_uint32(db, vstring, &version); + if (!NT_STATUS_IS_OK(status)) { version = 0; } @@ -321,6 +321,7 @@ bool account_policy_get(enum pdb_policy_type type, uint32_t *value) { const char *name; uint32 regval; + NTSTATUS status; if (!init_account_policy()) { return False; @@ -336,7 +337,8 @@ bool account_policy_get(enum pdb_policy_type type, uint32_t *value) return False; } - if (!dbwrap_fetch_uint32(db, name, ®val)) { + status = dbwrap_fetch_uint32(db, name, ®val); + if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("account_policy_get: tdb_fetch_uint32 failed for type %d (%s), returning 0\n", type, name)); return False; } diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index 565dd5d309..80a4b49f9d 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -325,9 +325,10 @@ static bool tdbsam_upgrade_next_rid(struct db_context *db) TDB_CONTEXT *tdb; uint32 rid; bool ok = false; + NTSTATUS status; - ok = dbwrap_fetch_uint32(db, NEXT_RID_STRING, &rid); - if (ok) { + status = dbwrap_fetch_uint32(db, NEXT_RID_STRING, &rid); + if (NT_STATUS_IS_OK(status)) { return true; } -- cgit