From: Jeremy Allison Date: Mon, 24 Apr 2017 23:00:17 +0000 (-0700) Subject: s4: torture: Add a TALLOC_CTX * to torture_parse_target(). X-Git-Tag: ldb-1.1.30~339 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6341d3d59f2cee3478e02eb0a6f6c96f31bda513;p=thirdparty%2Fsamba.git s4: torture: Add a TALLOC_CTX * to torture_parse_target(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- 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 */