s4: torture: Add a TALLOC_CTX * to torture_parse_target().
authorJeremy Allison <jra@samba.org>
Mon, 24 Apr 2017 23:00:17 +0000 (16:00 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 5 May 2017 13:52:11 +0000 (15:52 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source4/torture/shell.c
source4/torture/smbtorture.c
source4/torture/smbtorture.h

index aa85da3a8fc9539a09ff9780706c18e997bfaab7..cf561353731df9e59fde132140de8f7cd2c14514 100644 (file)
@@ -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);
        }
index 5038a47067fe5ff043d4ae4e473f0a2499006a01..13fe203ff64e3f618bddb45871dbdb5d1fa28ca9 100644 (file)
@@ -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 {
index cbb48234e366517ec71f3d98586ced5f923b911e..0a0647d6594fc36915f025949c2304517a5392b5 100644 (file)
@@ -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 */