s3:passdb:account_pol: use dbwrap_fetch_uint32, not dbwrap_fetch_int32 for the DB...
authorMichael Adam <obnox@samba.org>
Thu, 6 Oct 2011 18:00:17 +0000 (20:00 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 11 Oct 2011 12:17:58 +0000 (14:17 +0200)
This is also stored as uint32_t.

source3/passdb/account_pol.c

index 9b6e4f6c63a912b54dbec039d41dca618f625fca..dd495082a282ff932c75d4b633a991c8c992510e 100644 (file)
@@ -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