From 3ab37a0d0e8da0a149f3b0c4b0f54d4a7e8a66cf Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Thu, 3 Nov 2011 14:57:52 +0100 Subject: s3:net registry check: adapt to new semantic of dbwrap_fetch with rbt Signed-off-by: Michael Adam Autobuild-User: Michael Adam Autobuild-Date: Tue Nov 29 19:53:30 CET 2011 on sn-devel-104 --- source3/utils/net_registry_check.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/utils/net_registry_check.c') diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c index c51a2f02b9..ce7032ab64 100644 --- a/source3/utils/net_registry_check.c +++ b/source3/utils/net_registry_check.c @@ -264,22 +264,19 @@ static struct regkey* check_ctx_lookup_key(struct check_ctx *ctx, const char *path) { struct regkey *ret = NULL; NTSTATUS status; - TDB_DATA val; + TDB_DATA val = tdb_null; if ( path == NULL) { return ctx->root; } status = dbwrap_fetch(ctx->reg, ctx, string_term_tdb_data(path), &val); - if (!NT_STATUS_IS_OK(status)) { - return NULL; - } - if (val.dptr != NULL) { + if (NT_STATUS_IS_OK(status)) { if (ctx->opt.verbose) { printf("Open: %s\n", path); } ret = *(struct regkey**)val.dptr; - } else { + } else if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { /* not yet existing, create */ char *pp; if (ctx->opt.verbose) { @@ -304,6 +301,9 @@ check_ctx_lookup_key(struct check_ctx *ctx, const char *path) { dbwrap_store(ctx->reg, string_term_tdb_data(path), make_tdb_data((void*)&ret, sizeof(ret)), 0); + } else { + DEBUG(0, ("lookup key: failed to fetch %s: %s\n", path, + nt_errstr(status))); } done: talloc_free(val.dptr); -- cgit