diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-10-29 12:12:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:02 -0500 |
commit | 9ba6c3885acb79d9c35e600f9a67f8ed0200edfd (patch) | |
tree | f730ef7a01d9d42f43df21fca4b4bfb513739209 /source4/lib/registry/reg_backend_rpc | |
parent | a29c24f180cc21b358c51a86632eb1cc2cb17868 (diff) | |
download | samba-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/reg_backend_rpc')
-rw-r--r-- | source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c index 31e55bc9a3..27bd3ff957 100644 --- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c +++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c @@ -122,6 +122,7 @@ static WERROR rpc_open_hive(TALLOC_CTX *mem_ctx, struct registry_hive *h, struct user = talloc_strdup(mem_ctx, h->credentials); pass = strchr(user, '%'); if (pass) { + *pass = '\0'; pass = strdup(pass+1); } else { pass = strdup(""); @@ -136,14 +137,20 @@ static WERROR rpc_open_hive(TALLOC_CTX *mem_ctx, struct registry_hive *h, struct h->backend_data = p; - if(NT_STATUS_IS_ERR(status)) return ntstatus_to_werror(status); + if(NT_STATUS_IS_ERR(status)) { + DEBUG(1, ("Unable to open '%s': %s\n", h->location, nt_errstr(status))); + return ntstatus_to_werror(status); + } for(n = 0; known_hives[n].name; n++) { if(!strcmp(known_hives[n].name, h->backend_hivename)) break; } - if(!known_hives[n].name) return WERR_NO_MORE_ITEMS; + if(!known_hives[n].name) { + DEBUG(1, ("No such hive %s\n", known_hives[n].name)); + return WERR_NO_MORE_ITEMS; + } *k = talloc_p(mem_ctx, struct registry_key); (*k)->backend_data = mykeydata = talloc_p(mem_ctx, struct rpc_key_data); |