From f03e4aea66aa59662a49b3dc60917d7b619d7af2 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 6 Oct 2011 20:00:17 +0200 Subject: s3:passdb:account_pol: use dbwrap_fetch_uint32, not dbwrap_fetch_int32 for the DB version This is also stored as uint32_t. --- source3/passdb/account_pol.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/passdb/account_pol.c b/source3/passdb/account_pol.c index 9b6e4f6c63..dd495082a2 100644 --- a/source3/passdb/account_pol.c +++ b/source3/passdb/account_pol.c @@ -211,8 +211,9 @@ bool init_account_policy(void) { const char *vstring = "INFO/version"; - uint32 version; + uint32_t version = 0; int i; + bool ret; if (db != NULL) { return True; @@ -231,7 +232,11 @@ bool init_account_policy(void) } } - version = dbwrap_fetch_int32(db, vstring); + ret = dbwrap_fetch_uint32(db, vstring, &version); + if (!ret) { + version = 0; + } + if (version == DATABASE_VERSION) { return true; } @@ -244,7 +249,11 @@ bool init_account_policy(void) return false; } - version = dbwrap_fetch_int32(db, vstring); + ret = dbwrap_fetch_uint32(db, vstring, &version); + if (!ret) { + version = 0; + } + if (version == DATABASE_VERSION) { /* * Race condition -- cgit