Opened 4 months ago

Last modified 4 months 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: psmedley Owned by: psmedley
Priority: critical Milestone:
Component: Samba Client Version: Client 3.0.x
Keywords: Cc: lewisr

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 Changed 4 months ago by psmedley

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

comment:2 Changed 4 months ago by psmedley

  • Owner set to psmedley
  • Status changed from new to assigned

comment:3 Changed 4 months ago by psmedley

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.