summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-05-24 22:57:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:36 -0500
commit1bd7f6ae63566f34a78f82712bb005e507968187 (patch)
treec8b0f1a951476bc054207a090957bd850c0bd41e /source4/lib/registry/tools
parent7ef96bd3c4beb9a5bbef2b75819181ca8dc70be9 (diff)
downloadsamba-1bd7f6ae63566f34a78f82712bb005e507968187.tar.gz
samba-1bd7f6ae63566f34a78f82712bb005e507968187.tar.bz2
samba-1bd7f6ae63566f34a78f82712bb005e507968187.zip
r15877: Fix error message - caught by the IBM checker
(This used to be commit dd0b912fdd107817273391cab223304f0399c3b5)
Diffstat (limited to 'source4/lib/registry/tools')
-rw-r--r--source4/lib/registry/tools/regtree.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c
index e606e09add..c239a11ed4 100644
--- a/source4/lib/registry/tools/regtree.c
+++ b/source4/lib/registry/tools/regtree.c
@@ -108,16 +108,29 @@ int main(int argc, char **argv)
if (remote) {
error = reg_open_remote(&h, NULL, cmdline_credentials, remote, NULL);
+
+ if(!W_ERROR_IS_OK(error)) {
+ fprintf(stderr, "Unable to open remote registry at %s:%s \n", remote, win_errstr(error));
+ return 1;
+ }
+
} else if (backend) {
error = reg_open_hive(NULL, backend, poptGetArg(pc), NULL, cmdline_credentials, &root);
+
+ if(!W_ERROR_IS_OK(error)) {
+ fprintf(stderr, "Unable to open '%s' with backend '%s':%s \n", poptGetArg(pc), backend, win_errstr(error));
+ return 1;
+ }
} else {
error = reg_open_local (&h, NULL, cmdline_credentials);
- }
- if(!W_ERROR_IS_OK(error)) {
- fprintf(stderr, "Unable to open '%s' with backend '%s':%s \n", poptGetArg(pc), backend, win_errstr(error));
- return 1;
+ if(!W_ERROR_IS_OK(error)) {
+ fprintf(stderr, "Unable to open local registry:%s \n", win_errstr(error));
+ return 1;
+ }
+
}
+
poptFreeContext(pc);
error = WERR_OK;