summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_tdb.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/winbindd/idmap_tdb.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/winbindd/idmap_tdb.c')
-rw-r--r--source3/winbindd/idmap_tdb.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index b520e09103..c19c9c8163 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -251,17 +251,17 @@ static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
bool update_uid = false;
bool update_gid = false;
struct idmap_tdb_context *ctx;
- bool status;
+ NTSTATUS status;
ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
status = dbwrap_fetch_uint32(ctx->db, HWM_USER, &low_uid);
- if (!status || low_uid < dom->low_id) {
+ if (!NT_STATUS_IS_OK(status) || low_uid < dom->low_id) {
update_uid = true;
}
status = dbwrap_fetch_uint32(ctx->db, HWM_GROUP, &low_gid);
- if (!status || low_gid < dom->low_id) {
+ if (!NT_STATUS_IS_OK(status) || low_gid < dom->low_id) {
update_gid = true;
}
@@ -404,12 +404,11 @@ static NTSTATUS idmap_tdb_allocate_id_action(struct db_context *db,
NTSTATUS ret;
struct idmap_tdb_allocate_id_context *state;
uint32_t hwm;
- bool ret2;
state = (struct idmap_tdb_allocate_id_context *)private_data;
- ret2 = dbwrap_fetch_uint32(db, state->hwmkey, &hwm);
- if (!ret2) {
+ ret = dbwrap_fetch_uint32(db, state->hwmkey, &hwm);
+ if (!NT_STATUS_IS_OK(ret)) {
ret = NT_STATUS_INTERNAL_DB_ERROR;
goto done;
}