summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_tdb2.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_tdb2.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_tdb2.c')
-rw-r--r--source3/winbindd/idmap_tdb2.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c
index 0f50f615a1..ab47fe5389 100644
--- a/source3/winbindd/idmap_tdb2.c
+++ b/source3/winbindd/idmap_tdb2.c
@@ -63,14 +63,13 @@ static NTSTATUS idmap_tdb2_init_hwm(struct idmap_domain *dom)
NTSTATUS status;
uint32 low_id;
struct idmap_tdb2_context *ctx;
- bool ret;
ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context);
/* Create high water marks for group and user id */
- ret = dbwrap_fetch_uint32(ctx->db, HWM_USER, &low_id);
- if (!ret || (low_id < dom->low_id)) {
+ status = dbwrap_fetch_uint32(ctx->db, HWM_USER, &low_id);
+ if (!NT_STATUS_IS_OK(status) || (low_id < dom->low_id)) {
status = dbwrap_trans_store_uint32(ctx->db, HWM_USER,
dom->low_id);
if (!NT_STATUS_IS_OK(status)) {
@@ -80,8 +79,8 @@ static NTSTATUS idmap_tdb2_init_hwm(struct idmap_domain *dom)
}
}
- ret = dbwrap_fetch_uint32(ctx->db, HWM_GROUP, &low_id);
- if (!ret || (low_id < dom->low_id)) {
+ status = dbwrap_fetch_uint32(ctx->db, HWM_GROUP, &low_id);
+ if (!NT_STATUS_IS_OK(status) || (low_id < dom->low_id)) {
status = dbwrap_trans_store_uint32(ctx->db, HWM_GROUP,
dom->low_id);
if (!NT_STATUS_IS_OK(status)) {
@@ -144,12 +143,11 @@ static NTSTATUS idmap_tdb2_allocate_id_action(struct db_context *db,
NTSTATUS ret;
struct idmap_tdb2_allocate_id_context *state;
uint32_t hwm;
- bool ret2;
state = (struct idmap_tdb2_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;
}