s4/torture: move deletion out of close loop in torture_smb2_maxfid()
authorRalph Boehme <slow@samba.org>
Fri, 22 Jan 2021 06:57:31 +0000 (07:57 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 28 Jan 2021 08:11:49 +0000 (08:11 +0000)
A subsequent commit is changing the delete-on-close code in the fileserver to
open a handle on the parent directory of the file that is to be deleted.

If we've consumed all available handles, that open would fail causing a test
failure. As it's not really needed for the test semantics, don't set
delete-on-close when closing the handles, instead let the subsequent
smb2_deltree() do the cleanup.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/smb2/maxfid.c

index 853b13de6ded3568d54e692e402aa7c65083a6e3..5f0b9fee34a5115a51a09cc75df6f7c0d60d574c 100644 (file)
@@ -136,16 +136,6 @@ bool torture_smb2_maxfid(struct torture_context *tctx)
        torture_comment(tctx, "Cleanup open files\n");
 
        for (i = 0; i < maxfid; i++) {
-               union smb_setfileinfo sfinfo = { };
-
-               sfinfo.disposition_info.in.delete_on_close = 1;
-               sfinfo.generic.level = RAW_SFILEINFO_DISPOSITION_INFORMATION;
-               sfinfo.generic.in.file.handle = handles[i];
-
-               status = smb2_setinfo_file(tree, &sfinfo);
-               torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
-                                               "SETINFO failed\n");
-
                status = smb2_util_close(tree, handles[i]);
                torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
                                                "CLOSE failed\n");