diff options
Diffstat (limited to 'source4/lib/registry/tools')
-rw-r--r-- | source4/lib/registry/tools/common.c | 3 | ||||
-rw-r--r-- | source4/lib/registry/tools/regshell.c | 8 | ||||
-rw-r--r-- | source4/lib/registry/tools/regtree.c | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/source4/lib/registry/tools/common.c b/source4/lib/registry/tools/common.c index c9293cd310..29e96475e6 100644 --- a/source4/lib/registry/tools/common.c +++ b/source4/lib/registry/tools/common.c @@ -42,13 +42,14 @@ struct registry_context *reg_common_open_remote(const char *remote, } struct registry_key *reg_common_open_file(const char *path, + struct loadparm_context *lp_ctx, struct cli_credentials *creds) { struct hive_key *hive_root; struct registry_context *h; WERROR error; - error = reg_open_hive(NULL, path, NULL, creds, &hive_root); + error = reg_open_hive(NULL, path, NULL, creds, lp_ctx, &hive_root); if(!W_ERROR_IS_OK(error)) { fprintf(stderr, "Unable to open '%s': %s \n", diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 2c692952fb..329d6ab670 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -500,7 +500,7 @@ int main(int argc, char **argv) ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials); } else if (file != NULL) { - ctx->current = reg_common_open_file(file, cmdline_credentials); + ctx->current = reg_common_open_file(file, cmdline_lp_ctx, cmdline_credentials); if (ctx->current == NULL) return 1; ctx->registry = ctx->current->context; @@ -546,12 +546,16 @@ int main(int argc, char **argv) via readline :-( */ line = smb_readline(prompt, NULL, reg_completion); - if (line == NULL) + if (line == NULL) { + free(prompt); break; + } if (line[0] != '\n') { ret = W_ERROR_IS_OK(process_cmd(ctx, line)); } + free(line); + free(prompt); } talloc_free(ctx); diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index b267e11b43..0f47d8f8dd 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -131,7 +131,7 @@ int main(int argc, char **argv) if (remote != NULL) { h = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials); } else if (file != NULL) { - start_key = reg_common_open_file(file, cmdline_credentials); + start_key = reg_common_open_file(file, cmdline_lp_ctx, cmdline_credentials); } else { h = reg_common_open_local(cmdline_credentials, cmdline_lp_ctx); } |