s3:torture: Rename the test file and remove it if it exists
authorAndreas Schneider <asn@samba.org>
Fri, 19 Oct 2018 13:24:14 +0000 (15:24 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 27 Oct 2018 19:24:23 +0000 (21:24 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/torture.c

index 71ff4d6..333b1f1 100644 (file)
@@ -8121,6 +8121,7 @@ static bool run_chain1(int dummy)
        struct tevent_req *reqs[3], *smbreqs[3];
        bool done = false;
        const char *str = "foobar";
+       const char *fname = "\\test_chain";
        NTSTATUS status;
 
        printf("starting chain1 test\n");
@@ -8130,7 +8131,9 @@ static bool run_chain1(int dummy)
 
        smbXcli_conn_set_sockopt(cli1->conn, sockops);
 
-       reqs[0] = cli_openx_create(talloc_tos(), evt, cli1, "\\test",
+       cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+
+       reqs[0] = cli_openx_create(talloc_tos(), evt, cli1, fname,
                                  O_CREAT|O_RDWR, 0, &smbreqs[0]);
        if (reqs[0] == NULL) return false;
        tevent_req_set_callback(reqs[0], chain1_open_completion, NULL);