From: Stefan Metzmacher Date: Tue, 2 Jun 2020 11:52:23 +0000 (+0200) Subject: s4:torture:smb2: use delete-on-close in test_rw_invalid() X-Git-Tag: ldb-2.2.0~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e141739617c771cea39033893fce3c2559d125;p=thirdparty%2Fsamba.git s4:torture:smb2: use delete-on-close in test_rw_invalid() We test the limits here and leave a 16TB file with zeros. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Fri Jun 5 13:17:55 UTC 2020 on sn-devel-184 --- diff --git a/source4/torture/smb2/read_write.c b/source4/torture/smb2/read_write.c index b0eea55d7f1..707a49b6b1c 100644 --- a/source4/torture/smb2/read_write.c +++ b/source4/torture/smb2/read_write.c @@ -169,6 +169,7 @@ static bool test_rw_invalid(struct torture_context *torture, struct smb2_tree *t uint8_t buf[64*1024]; struct smb2_read rd; struct smb2_write w = {0}; + union smb_setfileinfo sfinfo; TALLOC_CTX *tmp_ctx = talloc_new(tree); ZERO_STRUCT(buf); @@ -178,6 +179,14 @@ static bool test_rw_invalid(struct torture_context *torture, struct smb2_tree *t status = torture_smb2_testfile(tree, FNAME, &h); CHECK_STATUS(status, NT_STATUS_OK); + /* set delete-on-close */ + ZERO_STRUCT(sfinfo); + sfinfo.generic.level = RAW_SFILEINFO_DISPOSITION_INFORMATION; + sfinfo.disposition_info.in.delete_on_close = 1; + sfinfo.generic.in.file.handle = h; + status = smb2_setinfo_file(tree, &sfinfo); + CHECK_STATUS(status, NT_STATUS_OK); + status = smb2_util_write(tree, h, buf, 0, ARRAY_SIZE(buf)); CHECK_STATUS(status, NT_STATUS_OK);