From 9ba6c3885acb79d9c35e600f9a67f8ed0200edfd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 29 Oct 2004 12:12:24 +0000 Subject: r3368: Default to rpc backend with binding "ncalrpc:" if no backend was specified in the various registry tools. Allow opening a remote registry to partly fail (I.e. if not all hives could be opened) (This used to be commit 313034b10d7a70d079e2bec1af38cf2a7cd918c1) --- source4/lib/registry/common/reg_interface.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source4/lib/registry/common') diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c index 999203f4d1..044dc9a0ad 100644 --- a/source4/lib/registry/common/reg_interface.c +++ b/source4/lib/registry/common/reg_interface.c @@ -132,9 +132,9 @@ WERROR reg_list_available_hives(TALLOC_CTX *mem_ctx, const char *backend, const WERROR reg_open(struct registry_context **ret, const char *backend, const char *location, const char *credentials) { - WERROR error = reg_create(ret); + WERROR error = reg_create(ret), reterror = WERR_NO_MORE_ITEMS; char **hives; - int i; + int i, j; TALLOC_CTX *mem_ctx = talloc_init("reg_open"); if(!W_ERROR_IS_OK(error)) return error; @@ -147,11 +147,15 @@ WERROR reg_open(struct registry_context **ret, const char *backend, const char * if(!W_ERROR_IS_OK(error)) return error; + j = 0; for(i = 0; hives[i]; i++) { error = reg_import_hive(*ret, backend, location, credentials, hives[i]); - if(!W_ERROR_IS_OK(error)) return error; - (*ret)->hives[i]->name = talloc_strdup((*ret)->mem_ctx, hives[i]); + if (W_ERROR_IS_OK(error)) { + reterror = WERR_OK; + (*ret)->hives[j]->name = talloc_strdup((*ret)->mem_ctx, hives[i]); + j++; + } else if (!W_ERROR_IS_OK(reterror)) reterror = error; } return WERR_OK; -- cgit