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

--- Comment #56 from madc...@atlas.cz ---
I did some more digging to figure out how KIO works under the hood and where it
makes Dolphin think that some of the Samba shares are not writable. Here is
what I found out so far:

Apparently every KIO directory is supposed to have a "." UDSEntry. If it is not
there, KIO tries to save the day and creates a default one. kio_smb does not
create the "." entries and relies on the KIO framework to handle this. I am
uncertain what implications this could have. Additionally, there is a case
where kio_smb signals both finished() and error() to KIO which is apparently
not allowed. Without my previous partial fix applied, I could perfectly
reproduce the following behavior:

- Samba server is opened, the root directory which contains all of the
individual shares incorrectly appears as writable in Dolphin
- Upon opening the first share, Dolphin uses the default-created "." UDSEntry
which has perms set to 775 and the share appears writable
- Upon going back and opening another share, Dolphin reads the perms from the
"NameOfTheShare" UDSEntry. Prior to applying my partial fix, the perms were set
to 555 and the root of the share was read-only.
- The same behavior applies to any other shares provided by the server. The
only share that will appear as writable is the share that was accessed first.

I cooked up two patches that should get kio_smb more in line with the KIO
framework expectations.

- The "." UDSEntry is now always created. If the directory does not have a
parent (server, workgroup) the UDSEntry is created with read-only permissions.
Otherwise the correct permissions are fetched through libsmbclient.
- There is a (a bit kludgy) fix for a case where kio_smb signals both
finished() and error() to KIO.

With these two patches in place on top of the previous patch KIO no longer
complains about kio_smb's misbehavior and Dolphin behaves in a sensible way
when browsing Samba shares. As far as I could test it works fine for me with no
complains from KIO in the logs.

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

Reply via email to