summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-11-03 14:57:52 +0100
committerMichael Adam <obnox@samba.org>2011-11-29 19:53:30 +0100
commit3ab37a0d0e8da0a149f3b0c4b0f54d4a7e8a66cf (patch)
treed50c5da01bc5e00f3152771cbadc82724f51613a /source3
parentbca2677afe0646e5436356d73c4acee7844e8056 (diff)
downloadsamba-3ab37a0d0e8da0a149f3b0c4b0f54d4a7e8a66cf.tar.gz
samba-3ab37a0d0e8da0a149f3b0c4b0f54d4a7e8a66cf.tar.bz2
samba-3ab37a0d0e8da0a149f3b0c4b0f54d4a7e8a66cf.zip
s3:net registry check: adapt to new semantic of dbwrap_fetch with rbt
Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Tue Nov 29 19:53:30 CET 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_registry_check.c12
1 files changed, 6 insertions, 6 deletions
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);