summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_autorid.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_autorid.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_autorid.c')
-rw-r--r--source3/winbindd/idmap_autorid.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index ed00d3728d..62339f1328 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -66,13 +66,15 @@ static NTSTATUS idmap_autorid_get_domainrange(struct db_context *db,
cfg = (struct autorid_domain_config *)private_data;
dom_sid_string_buf(&(cfg->sid), sidstr, sizeof(sidstr));
- if (!dbwrap_fetch_uint32(db, sidstr, &domainnum)) {
+ ret = dbwrap_fetch_uint32(db, sidstr, &domainnum);
+ if (!NT_STATUS_IS_OK(ret)) {
DEBUG(10, ("Acquiring new range for domain %s\n", sidstr));
/* fetch the current HWM */
- if (!dbwrap_fetch_uint32(db, HWM, &hwm)) {
+ ret = dbwrap_fetch_uint32(db, HWM, &hwm);
+ if (!NT_STATUS_IS_OK(ret)) {
DEBUG(1, ("Fatal error while fetching current "
- "HWM value!\n"));
+ "HWM value: %s\n", nt_errstr(ret)));
ret = NT_STATUS_INTERNAL_ERROR;
goto error;
}
@@ -519,9 +521,10 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
/* read previously stored config and current HWM */
storedconfig = idmap_autorid_loadconfig(talloc_tos());
- if (!dbwrap_fetch_uint32(autorid_db, HWM, &hwm)) {
+ status = dbwrap_fetch_uint32(autorid_db, HWM, &hwm);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Fatal error while fetching current "
- "HWM value!\n"));
+ "HWM value: %s\n", nt_errstr(status)));
status = NT_STATUS_INTERNAL_ERROR;
goto error;
}
@@ -590,8 +593,10 @@ static NTSTATUS idmap_autorid_allocate_id(struct idmap_domain *dom,
globalcfg = talloc_get_type(dom->private_data,
struct autorid_global_config);
- if (!dbwrap_fetch_uint32(autorid_db, ALLOC_HWM, &hwm)) {
- DEBUG(1, ("Failed to fetch current allocation HWM value!\n"));
+ ret = dbwrap_fetch_uint32(autorid_db, ALLOC_HWM, &hwm);
+ if (!NT_STATUS_IS_OK(ret)) {
+ DEBUG(1, ("Failed to fetch current allocation HWM value: %s\n",
+ nt_errstr(ret)));
return NT_STATUS_INTERNAL_ERROR;
}