summaryrefslogtreecommitdiff
path: root/source4/lib/registry/common
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-10-29 12:12:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:02 -0500
commit9ba6c3885acb79d9c35e600f9a67f8ed0200edfd (patch)
treef730ef7a01d9d42f43df21fca4b4bfb513739209 /source4/lib/registry/common
parenta29c24f180cc21b358c51a86632eb1cc2cb17868 (diff)
downloadsamba-9ba6c3885acb79d9c35e600f9a67f8ed0200edfd.tar.gz
samba-9ba6c3885acb79d9c35e600f9a67f8ed0200edfd.tar.bz2
samba-9ba6c3885acb79d9c35e600f9a67f8ed0200edfd.zip
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)
Diffstat (limited to 'source4/lib/registry/common')
-rw-r--r--source4/lib/registry/common/reg_interface.c12
1 files changed, 8 insertions, 4 deletions
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;