gvfs truncates files in ftp and ftps
Xubuntu 20.04 LTS Kernel linux: 5.4.0-37-generic gvfs version: 1.44.1-1ubuntu1
This bug occurs when I opened, modified and saved a file from a FTP server through a gvfs-ftp connection. In my case, I used the file manager Thunar to connect to a FTP server and used sublime text to add content to a huge file on the server (more than 200kB). When I saved it (which triggers the sending of the file to the server), the file on the server is passed from 200kB to 160kB. Re-save the file doesn't change anything. When I closed and re-opened it, I see the end of the file had been truncated and the end of it had been lost.
It seems not be a connection problem because it occurs often on several FTP server.
This bug not occurs with gvfs-sftp.
It isn't a server problem because there is no problem with other FTP client like Filezilla.
To reproduce:
- Connect to a FTP server with Thunar (or another program which use gvfs)
- Create a text file of at least 100 kB with lorem upsum
- Open it in a text editor FROM Thunar through gvfs (the path must be like "/run/user/1000/gvfs/ftp=myserver.com,port=22,user=test/path/to/file/on/server")
- Copy and paste 2 times the content (make the file grows up to 300KB)
- When you save, you have a chance to see the file have a lower size than before (even you add data)
- Close the text editor, re-open the file from thunar, you will see there is missing data at the end of the file.