SUMMARY KIO 6.16.0 has broke ability to access remote root (/) directory via SFTP. User's home dir is always shown instead. STEPS TO REPRODUCE 1. Connect to any SFTP server via Dolphin and navigate to the root directory, e.g. 'sftp://user@server//'. OBSERVED RESULT User's home dir always shown instead of /. EXPECTED RESULT / should be accessible. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux KDE Plasma Version: 6.4.3 KDE Frameworks Version: 6.16.0 Qt Version: 6.9.1 ADDITIONAL INFORMATION I performed bisection and found the offending commit: commit 883a16eb4ac808deceddf8ac3667ee888ff8ea60 (HEAD) Author: Akseli Lahtinen <akselmo@akselmo.dev> Date: Wed Jun 25 13:23:07 2025 +0300 KCoreDirLister: Clean up the trailing slash as expected on remote systems Due to QTBUG-35921 we sometimes get a trailing slash even if we expect it to be removed. This patch adds a method that makes sure the trailing slash is completely removed from the URL and returns the cleaned URL, but only if the file is in remote directoy. The code was built around the behavior of the trailing slash always being removed, so it was comparing URLs: Even if the URLs point to same location, `smb://aaa` and `smb://aaa/`, the URLs are considered as different ones. On remote systems we do not know if the file system allows `foo/bar` and `foo/bar/` to be the exact same or not. On local systems we can rely on Qt. This fixes bug that would cause situations where the job is reusing itself for the two "different" URLs (from the point of view of the code) and asserting, as every different URL should have a new job. BUG: 451050 src/core/kcoredirlister.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++---------------------------- src/core/kcoredirlister_p.h | 10 ++++++++++ 2 files changed, 52 insertions(+), 28 deletions(-) Introduced in https://invent.kde.org/frameworks/kio/-/merge_requests/1921
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1940
*** Bug 507450 has been marked as a duplicate of this bug. ***
Git commit 2cf5289d9e994f830749eb30791aabe1719406f9 by Akseli Lahtinen. Committed on 28/07/2025 at 09:45. Pushed by akselmo into branch 'master'. KCoreDirLister: Do not list files again if the new url has same job When getting a redirection URL, we check if the URL already has a job or not. We also check that it's not the current job we're working on. If it has same job as given to the slot as parameter, we are not working on a new directory, but an old one. This can happen when we are in `sftp://foo@bar/home/foo`, then type `sftp://foo@bar` which in turn redirects us back to `sftp://foo@bar/home/foo`. In these cases, we know we're not working on a new directory, so we handle it through cache or refreshing it. This fixes crashes with the oldJob assert and also gives back to Qt the trailing slash handling, while keeping expected behavior. This also implements the mock test of commit 0808afd7 Related: bug 451050, bug 507185 M +4 -0 CMakeLists.txt M +70 -8 autotests/kdirlistertest.cpp M +3 -2 autotests/kdirlistertest.h M +9 -15 src/core/kcoredirlister.cpp M +4 -0 src/core/worker.cpp M +4 -0 src/core/worker_p.h https://invent.kde.org/frameworks/kio/-/commit/2cf5289d9e994f830749eb30791aabe1719406f9
*** Bug 507922 has been marked as a duplicate of this bug. ***