]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture/vfs/fruit: ensure a directory handle is closed in all code paths
authorRalph Boehme <slow@samba.org>
Wed, 31 Oct 2018 14:49:45 +0000 (15:49 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 6 Nov 2018 08:10:23 +0000 (09:10 +0100)
Otherwise we get a sharing violation when running against Samba and
opening the directory a second time.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f7551d8fb3599a6a71dd0570bad02bdc48324107)

source4/torture/vfs/fruit.c

index 0750026f1d5ba0460897dcd5cdd211b166fd8955..c34ae1a73d4ef436db0c6cb4863052b497426403 100644 (file)
@@ -3232,15 +3232,12 @@ static bool test_rename_dir_openfile(struct torture_context *torture,
                torture_assert_ntstatus_equal(torture, status,
                                              NT_STATUS_ACCESS_DENIED,
                                              "smb2_setinfo_file");
-
-               ZERO_STRUCT(cl.smb2);
-               cl.smb2.level = RAW_CLOSE_SMB2;
-               cl.smb2.in.file.handle = d1;
-               status = smb2_close(tree, &(cl.smb2));
-               torture_assert_ntstatus_ok(torture, status, "smb2_close");
-               ZERO_STRUCT(d1);
        }
 
+       status = smb2_util_close(tree, d1);
+       torture_assert_ntstatus_ok(torture, status, "smb2_util_close\n");
+       ZERO_STRUCT(d1);
+
        torture_comment(torture, "Enabling AAPL\n");
 
        ret = enable_aapl(torture, tree);