summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools/regpatch.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-10 20:07:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:29 -0500
commit444a86792471c0bef33dde15c7a4a33e16a951b4 (patch)
tree075b0cdd27acb80470a4e90e99598cbcea3b082c /source4/lib/registry/tools/regpatch.c
parent60c69445f6fa86b27bd697cc8af52b582f620725 (diff)
downloadsamba-444a86792471c0bef33dde15c7a4a33e16a951b4.tar.gz
samba-444a86792471c0bef33dde15c7a4a33e16a951b4.tar.bz2
samba-444a86792471c0bef33dde15c7a4a33e16a951b4.zip
r4132: - Bunch of rather large fixes in the registry
- Added some README files Not everything works yet, e.g. the EnumValue test appears to be broken. (This used to be commit c169e86c1f52763b83e77e509f89cb91f9b69071)
Diffstat (limited to 'source4/lib/registry/tools/regpatch.c')
-rw-r--r--source4/lib/registry/tools/regpatch.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index be60b96019..a4a4649c96 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -758,16 +758,14 @@ static int nt_apply_reg_command_file(struct registry_context *r, const char *cmd
{
int opt;
poptContext pc;
- const char *location;
- const char *credentials = NULL;
const char *patch;
- const char *backend = "rpc";
struct registry_context *h;
+ const char *remote = NULL;
WERROR error;
struct poptOption long_options[] = {
POPT_AUTOHELP
- {"backend", 'b', POPT_ARG_STRING, &backend, 'b', "backend to use", NULL},
- {"credentials", 'c', POPT_ARG_STRING, &credentials, 'c', "credentials (user%password", NULL},
+ POPT_COMMON_CREDENTIALS
+ {"remote", 'R', POPT_ARG_STRING, &remote, 0, "connect to specified remote server", NULL},
POPT_TABLEEND
};
@@ -785,25 +783,22 @@ static int nt_apply_reg_command_file(struct registry_context *r, const char *cmd
setup_logging(argv[0], True);
- location = poptGetArg(pc);
- if(!location) {
- poptPrintUsage(pc, stderr, 0);
- return 1;
+ if (remote) {
+ error = reg_open_remote (&h, cmdline_get_username(), cmdline_get_userpassword(), remote);
+ } else {
+ error = reg_open_local (&h);
}
- error = reg_open(&h, backend, location, credentials);
- if(!h) {
- fprintf(stderr, "Unable to open '%s' with backend '%s'\n", location, backend);
+ if (W_ERROR_IS_OK(error)) {
+ fprintf(stderr, "Error: %s\n", win_errstr(error));
return 1;
}
-
+
patch = poptGetArg(pc);
if(!patch) patch = "/dev/stdin";
poptFreeContext(pc);
nt_apply_reg_command_file(h, patch);
- talloc_destroy(h->mem_ctx);
-
return 0;
}