Opened 8 years ago
Last modified 8 years ago
#279 assigned defect
Saving a file with MED editor on an SMB2+ share causes the file size to be set to 0
Reported by: | Paul Smedley | Owned by: | Paul Smedley |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Samba Client | Version: | Client 3.0.x |
Keywords: | Cc: | Lewis Rosenthal |
Description
There is a major issue with saving files with the MED editor on a SMB2+ share. After saving a file, the file size is 0 and the file is destroyed.
Change History (3)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 8 years ago
FYI - cli_ftruncate issue is confirmed as an upstream bug - https://bugzilla.samba.org/show_bug.cgi?id=12479
I still believe the cli_open() when cli_ftruncate fails is bogus and destructive.
Note:
See TracTickets
for help on using tickets.
Logs show: 2016/12/21 17:30:05.48: 4 4: cli_setnewfilesize(\readme.txt) 1832 2016/12/21 17:30:05.48: 4 4: cli_setnewfileszie : cli_open(\readme.txt) attr 00000000 mode 501 denymode 02 2016/12/21 17:30:05.49: 9 4: NdpFileNewSizeL <\readme.txt> 1832 0
note the reference to cli_open() does NOT occur with a SMB1 share.
It seems cli_ftruncate() is failing on a SMB2+ share (reasons unclear). When it fails, ndpsmb is re-opening the file, and overwriting it. I'm really not clear what the purpose of re-opening the file in smbwrp_setfilesize() is. I'm open to input, but for now, in the event of a failure of cli_ftruncate(), I'm just returning the rc, rather than re-opening the file.
I haven't yet committed this to the client-3.0 branch until I do some further testing, but there is an updated build of the 3.0 plugin at http://smedley.id.au/tmp/ndpsmb.zip