summaryrefslogtreecommitdiff
path: root/source3/passdb/account_pol.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-10-06 21:07:27 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:58 +0200
commit658f72128ff6950c6a03994198b4464a273fb300 (patch)
tree121d3cdd05b0cf84ef0eb2361c4aff21d24f5b46 /source3/passdb/account_pol.c
parent603c3e1bcb7b4106afe4aefdfed43e7832ede956 (diff)
downloadsamba-658f72128ff6950c6a03994198b4464a273fb300.tar.gz
samba-658f72128ff6950c6a03994198b4464a273fb300.tar.bz2
samba-658f72128ff6950c6a03994198b4464a273fb300.zip
s3:dbwrap: change dbwrap_fetch_uint32() to NTSTATUS return type (instead of bool)
for consistency and better error propagation
Diffstat (limited to 'source3/passdb/account_pol.c')
-rw-r--r--source3/passdb/account_pol.c14
1 files changed, 8 insertions, 6 deletions
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, &regval)) {
+ status = dbwrap_fetch_uint32(db, name, &regval);
+ 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;
}