SMB2 Write truncate
dmulder at suse.com
Mon Jan 13 22:47:26 UTC 2020
Based on the behavior of tests in source4/torture/basic/delaywrite.c, it seems sending a write request in smb1, with a buffer size of 0, would truncate the file (at least that's what the comments say in the test). There doesn't seem to be any reason for the offset size in these tests (some are less than the current size of the file, others are much greater than the current size, which doesn't make much sense).
I'm working on converting these tests to SMB2, but the behavior isn't the same. An SMB2 write responds with NT_STATUS_INVALID_PARAMETER when you set the buffer size to 0. I can't find in the MS-SMB2 spec how to correctly truncate a file. Anyone know how to do this?
Labs Software Engineer, Samba
1800 Novell Place
Provo, UT 84606
dmulder at suse.com<mailto:dmulder at suse.com>
More information about the samba-technical