r15877: Fix error message - caught by the IBM checker
authorJelmer Vernooij <jelmer@samba.org>
Wed, 24 May 2006 22:57:14 +0000 (22:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:08:36 +0000 (14:08 -0500)
(This used to be commit dd0b912fdd107817273391cab223304f0399c3b5)

source4/lib/registry/tools/regtree.c

index e606e09add4aebe099716bd92d337aea9b4205f5..c239a11ed437e636937a764d00d0e7a7fb1e1f1e 100644 (file)
@@ -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;