| Summary: | Symlinked files are truncated when accessed through SFTP (sftp_aio) | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] kio-extras | Reporter: | Kishore Gopalakrishnan <kishore96> |
| Component: | SFTP | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | john.kizer, phobosk |
| Priority: | NOR | ||
| Version First Reported In: | 24.08.3 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Other | ||
| Latest Commit: | https://invent.kde.org/network/kio-extras/-/commit/5fd0630699e5d0d150709bf0cd5e935d725137f0 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Kishore Gopalakrishnan
2024-12-08 10:05:34 UTC
Hi - thanks for the detailed report! I'm unable to reproduce it on my system below, though - has this situation ever worked correctly on your system (if you had ever tried it before?), even if under previous software versions? Operating System: Fedora Linux 41 KDE Plasma Version: 6.2.4 KDE Frameworks Version: 6.9.0 Qt Version: 6.8.1 Kernel Version: 6.12.4-200.fc41.x86_64 (64-bit) (In reply to John Kizer from comment #1) > Hi - thanks for the detailed report! I'm unable to reproduce it on my system > below, though - has this situation ever worked correctly on your system (if > you had ever tried it before?), even if under previous software versions? > > Operating System: Fedora Linux 41 > KDE Plasma Version: 6.2.4 > KDE Frameworks Version: 6.9.0 > Qt Version: 6.8.1 > Kernel Version: 6.12.4-200.fc41.x86_64 (64-bit) It used to work correctly on my system. Unfortunately, I'm not sure exactly how long ago it stopped working, since I don't access symlinks on remote systems that often. Fedora 41 has libssh 0.10.6, while I have 0.11.1 on Arch Linux. I suspect this could be related to the new feature mentioned in https://bugs.kde.org/show_bug.cgi?id=296526#c42 . One way to confirm this would be for me to build a version of kio-sftp with that feature patched out, but that will have to wait until the weekend at least. (In reply to Kishore Gopalakrishnan from comment #2) > [snip] > > Fedora 41 has libssh 0.10.6, while I have 0.11.1 on Arch Linux. I suspect > this could be related to the new feature mentioned in > https://bugs.kde.org/show_bug.cgi?id=296526#c42 . > > [snip] I have confirmed this. The bug is not reproducible if I remove the `HAVE_SFTP_AIO` option from kio-extras/sftp/CMakeLists.txt (forcing kio-sftp to always use the old code path). The issue is fixed by replacing all uses of `sftp_lstat` by `sftp_stat` in kio_sftp.cpp A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/403 Git commit 5fd0630699e5d0d150709bf0cd5e935d725137f0 by Méven Car, on behalf of Kishore Gopalakrishnan. Committed on 23/02/2025 at 10:07. Pushed by meven into branch 'master'. sftp: use stat instead of lstat Using lstat leads to symlinks being truncated (since the file gets truncated according to the size of the symlink, and not the size of the target file). open and sftpGet now use sftp_stat, while the remaining methods (sftpPut, stat, mkdir, rename, symlink) still use sftp_lstat. M +4 -2 sftp/kio_sftp.cpp https://invent.kde.org/network/kio-extras/-/commit/5fd0630699e5d0d150709bf0cd5e935d725137f0 *** Bug 501701 has been marked as a duplicate of this bug. *** |