summaryrefslogtreecommitdiff
path: root/source3/utils/net_idmap_check.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/utils/net_idmap_check.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/utils/net_idmap_check.c')
-rw-r--r--source3/utils/net_idmap_check.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/utils/net_idmap_check.c b/source3/utils/net_idmap_check.c
index eefb700816..960a597073 100644
--- a/source3/utils/net_idmap_check.c
+++ b/source3/utils/net_idmap_check.c
@@ -400,10 +400,12 @@ static void edit_record(struct record* r) {
static bool check_version(struct check_ctx* ctx) {
static const char* key = "IDMAP_VERSION";
uint32_t version;
- bool no_version = !dbwrap_fetch_uint32(ctx->db, key, &version);
+ NTSTATUS status;
char action = 's';
struct check_actions* act = &ctx->action;
- if (no_version) {
+
+ status = dbwrap_fetch_uint32(ctx->db, key, &version);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("No version number, assume 2\n");
action = get_action(&act->no_version, NULL, NULL);
} else if (version != 2) {
@@ -429,9 +431,11 @@ static bool check_version(struct check_ctx* ctx) {
static void check_hwm(struct check_ctx* ctx, const char* key, uint32_t target) {
uint32_t hwm;
char action = 's';
- bool found = dbwrap_fetch_uint32(ctx->db, key, &hwm);
+ NTSTATUS status;
struct check_actions* act = &ctx->action;
- if (!found) {
+
+ status = dbwrap_fetch_uint32(ctx->db, key, &hwm);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("No %s should be %d\n", key, target);
action = get_action(&act->invalid_hwm, NULL, NULL);
} else if (target < hwm) {