summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-04-24 16:00:17 -0700
committerJeremy Allison <jra@samba.org>2017-05-05 15:52:11 +0200
commit6341d3d59f2cee3478e02eb0a6f6c96f31bda513 (patch)
tree2d4aac473f94eaddb9bc2d37a92ab91badb66990
parentf18cc16cf1c5dc089e038cd894ee42890e377d48 (diff)
downloadsamba-6341d3d59f2cee3478e02eb0a6f6c96f31bda513.tar.gz
s4: torture: Add a TALLOC_CTX * to torture_parse_target().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
-rw-r--r--source4/torture/shell.c2
-rw-r--r--source4/torture/smbtorture.c11
-rw-r--r--source4/torture/smbtorture.h4
3 files changed, 11 insertions, 6 deletions
diff --git a/source4/torture/shell.c b/source4/torture/shell.c
index aa85da3a8fc..cf561353731 100644
--- a/source4/torture/shell.c
+++ b/source4/torture/shell.c
@@ -285,7 +285,7 @@ static void shell_target(const struct shell_command *command,
printf("Target share: %s\n", share ? share : "");
printf("Target binding: %s\n", binding ? binding : "");
} else if (argc == 1) {
- torture_parse_target(tctx->lp_ctx, argv[0]);
+ torture_parse_target(tctx, tctx->lp_ctx, argv[0]);
} else {
shell_usage(command);
}
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 5038a47067f..13fe203ff64 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -150,7 +150,9 @@ bool torture_run_named_tests(struct torture_context *torture, const char *name,
return ret;
}
-bool torture_parse_target(struct loadparm_context *lp_ctx, const char *target)
+bool torture_parse_target(TALLOC_CTX *ctx,
+ struct loadparm_context *lp_ctx,
+ const char *target)
{
char *host = NULL, *share = NULL;
struct dcerpc_binding *binding_struct;
@@ -160,7 +162,7 @@ bool torture_parse_target(struct loadparm_context *lp_ctx, const char *target)
if (!smbcli_parse_unc(target, NULL, &host, &share)) {
const char *h;
- status = dcerpc_parse_binding(talloc_autofree_context(), target, &binding_struct);
+ status = dcerpc_parse_binding(ctx, target, &binding_struct);
if (NT_STATUS_IS_ERR(status)) {
d_printf("Invalid option: %s is not a valid torture target (share or binding string)\n\n", target);
return false;
@@ -679,8 +681,9 @@ int main(int argc, const char *argv[])
printf("You must specify a test to run, or 'ALL'\n");
usage(pc);
torture->results->returncode = 1;
- } else if (!torture_parse_target(cmdline_lp_ctx, argv_new[1])) {
- /* Take the target name or binding. */
+ } else if (!torture_parse_target(torture,
+ cmdline_lp_ctx, argv_new[1])) {
+ /* Take the target name or binding. */
usage(pc);
torture->results->returncode = 1;
} else {
diff --git a/source4/torture/smbtorture.h b/source4/torture/smbtorture.h
index cbb48234e36..0a0647d6594 100644
--- a/source4/torture/smbtorture.h
+++ b/source4/torture/smbtorture.h
@@ -40,7 +40,9 @@ void torture_shell(struct torture_context *tctx);
void torture_print_testsuites(bool structured);
bool torture_run_named_tests(struct torture_context *torture, const char *name,
const char **restricted);
-bool torture_parse_target(struct loadparm_context *lp_ctx, const char *target);
+bool torture_parse_target(TALLOC_CTX *ctx,
+ struct loadparm_context *lp_ctx,
+ const char *target);
/* Server Functionality Support */