Bug 488581

Summary: SFTP File corruption
Product: [Applications] dolphin Reporter: Trowe <sergejpopovic22>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: arojas, dark0ne, kfm-devel, me, nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 24.08.2
Sentry Crash Report:

Description Trowe 2024-06-16 12:57:01 UTC
STEPS TO REPRODUCE
1. Open Dolphin
2. Connect to SFTP server
3. Edit the file from Dolphin
4. Open it from the host and you will see that it's corrupt

OBSERVED RESULT
Can't open the file anymore it's corrupt.

EXPECTED RESULT
Edited version of the file

SOFTWARE/OS VERSIONS
Arch Linux/Hyprland

ADDITIONAL INFORMATION
I'm using E-Trail FiveM hosting.
When I open and edit the file with Dolphin file is corrupted.
Doing the same thing in Nautilus or some other SFTP client works just fine.
Comment 1 aeneid 2024-08-27 07:14:31 UTC
I am experiencing similar  issues, when i copy an executable file to the server it gets corrupted, causing segfault when i try to run it.

Works find with other sftp clients.

I am also on Arch (EndeavourOS).
Comment 2 Bug Janitor Service 2024-08-27 18:06:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/369
Comment 3 Harald Sitter 2024-08-28 16:50:54 UTC
Git commit 0b589bd8744457dd5c427cc6b1626221b5e8d250 by Harald Sitter, on behalf of Ser Freeman.
Committed on 28/08/2024 at 16:46.
Pushed by sitter into branch 'master'.

sftp: account for maximum request length when using sftp_aio

As stated in the libssh documentation, AIO functions cap the allowed
length per request. Account for that by breaking up into multiple
requests when necessary.

M  +47   -12   sftp/kio_sftp.cpp

https://invent.kde.org/network/kio-extras/-/commit/0b589bd8744457dd5c427cc6b1626221b5e8d250
Comment 4 Antonio Rojas 2024-09-06 14:48:19 UTC
Please backport to 24.08, this is a severe data loss issue
Comment 5 Antonio Rojas 2024-09-11 10:52:36 UTC
Git commit f0fca6e20d1e71427caff9fc7ab3e8d7041d71ec by Antonio Rojas.
Committed on 09/09/2024 at 14:14.
Pushed by arojas into branch 'release/24.08'.

sftp: account for maximum request length when using sftp_aio

As stated in the libssh documentation, AIO functions cap the allowed
length per request. Account for that by breaking up into multiple
requests when necessary.


(cherry picked from commit 0b589bd8744457dd5c427cc6b1626221b5e8d250)

Co-authored-by: Ser Freeman <serfreeman1337@gmail.com>

M  +47   -12   sftp/kio_sftp.cpp

https://invent.kde.org/network/kio-extras/-/commit/f0fca6e20d1e71427caff9fc7ab3e8d7041d71ec