diff options
author | Ralph Boehme <slow@samba.org> | 2019-10-25 15:41:40 +0200 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2019-10-30 13:23:42 +0000 |
commit | b63069db9fb6efb33b7b917cd5b0ee06b0da9cdc (patch) | |
tree | 282b7f62d1e733678ab6bbe8381ce1ddb6ff7379 /source4 | |
parent | ef58222616fc3175f189417ce878d8413ba2d294 (diff) | |
download | samba-b63069db9fb6efb33b7b917cd5b0ee06b0da9cdc.tar.gz |
torture: expand test "vfs.fruit.resource fork IO" to check size
Reveals a bug where the resource fork size is capped at 65454 bytes.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/vfs/fruit.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index 3a6a198a658..94cbf277677 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -2397,6 +2397,35 @@ static bool test_write_atalk_rfork_io(struct torture_context *tctx, fname, AFPRESOURCE_STREAM_NAME, (off_t)64*1024*1024, 10, rfork_content); + /* Check size after write */ + + ZERO_STRUCT(io); + io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN; + io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE | + SEC_FILE_WRITE_ATTRIBUTE; + io.smb2.in.fname = rfork; + status = smb2_create(tree, mem_ctx, &(io.smb2)); + CHECK_STATUS(status, NT_STATUS_OK); + filehandle = io.smb2.out.file.handle; + + torture_comment(tctx, "(%s) check resource fork size after write\n", + __location__); + + ZERO_STRUCT(finfo); + finfo.generic.level = RAW_FILEINFO_ALL_INFORMATION; + finfo.generic.in.file.handle = filehandle; + status = smb2_getinfo_file(tree, mem_ctx, &finfo); + CHECK_STATUS(status, NT_STATUS_OK); + if (finfo.all_info.out.size != 64*1024*1024 + 10) { + torture_result(tctx, TORTURE_FAIL, + "(%s) Incorrect resource fork size\n", + __location__); + ret = false; + smb2_util_close(tree, filehandle); + goto done; + } + smb2_util_close(tree, filehandle); + ret &= check_stream(tree, __location__, tctx, mem_ctx, fname, AFPRESOURCE_STREAM_NAME, (off_t)64*1024*1024, 10, 0, 10, rfork_content); |