https://bugs.kde.org/show_bug.cgi?id=483297

Méven <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED
      Latest Commit|                            |https://invent.kde.org/fram
                   |                            |eworks/kio/-/commit/659ef10
                   |                            |fd031c5656e5b019fd8175dda85
                   |                            |f13e8a

--- Comment #5 from Méven <[email protected]> ---
Git commit 659ef10fd031c5656e5b019fd8175dda85f13e8a by Méven Car, on behalf of
Anton Bolshakov.
Committed on 13/07/2026 at 11:15.
Pushed by meven into branch 'master'.

file: strip local host from file:// URLs before accessing the path

Modern Qt's QUrl::isLocalFile() returns true even when a file:// URL
carries a host, and QUrl::toLocalFile() then keeps that host as a
UNC-style "//host/path". The file worker did detect that such a URL
refers to the local machine (isLocalFileSameHost), but afterwards
converted it to a local path without stripping the host, so e.g.
`file://localhost/etc` became "//localhost/etc" and failed with
"does not exist".

These URLs are produced for instance by `ls --hyperlink` and Midnight
Commander's OSC 7/OSC 8 escape sequences, which include the host (per
RFC 8089) so terminals can distinguish local from remote files.

Promote isLocalFileSameHost() to a shared, cross-platform helper and
strip the host in all file operations once the URL is known to refer to
this machine. Genuine remote hosts are left untouched and still redirect
to smb://.

Add a jobtest case covering stat() of file://localhost/, file://<host>/
and a case-insensitive host match.

M  +94   -0    autotests/jobtest.cpp
M  +4    -0    autotests/jobtest.h
M  +24   -0    autotests/openurljobtest.cpp
M  +1    -0    autotests/openurljobtest.h
M  +25   -1    src/gui/openurljob.cpp
M  +49   -13   src/kioworkers/file/file.cpp
M  +10   -0    src/kioworkers/file/file.h
M  +29   -24   src/kioworkers/file/file_unix.cpp

https://invent.kde.org/frameworks/kio/-/commit/659ef10fd031c5656e5b019fd8175dda85f13e8a

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to