Bug 484793 - File type/associations not being correctly detected on locally mounted samba shares
Summary: File type/associations not being correctly detected on locally mounted samba ...
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.02.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-31 02:26 UTC by DT
Modified: 2024-05-01 00:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Image of sample directory demonstrating file types not being displayed correctly (66.36 KB, image/png)
2024-03-31 02:26 UTC, DT
Details
Okteta being selected as default application (94.15 KB, image/png)
2024-03-31 02:27 UTC, DT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DT 2024-03-31 02:26:18 UTC
Created attachment 167969 [details]
Image of sample directory demonstrating file types not being displayed correctly

SUMMARY
When accessing files via a locally mounted samba share, files lacking a filename extension are not having their filetypes correctly detected and displayed. 

For instance, a plain text file named "test" is displayed as "Type: Unknown, Content: Plain text document" with a "?" icon.
In contrast, a plain text file named "test.txt" is displayed as "Type: Plain text document"  with the correct icon. 
This holds true for other file types. It is also problematic when attempting to access, say, a plaintext file with a ".conf' extension.

When attempting to open a file lacking a filename extension, "Okteta" is being defaulted to as the default application. When using the "open with" dialogue and selecting another application (along with ticking the "Remember application association for all files of this type" box), such as Kwrite for text files, the application association is not being saved, and Okteta remains the default application.

STEPS TO REPRODUCE
1. Mount a remote samba share locally with the following command:
mount -t cifs -o "uid=1000,gid=1000,file_mode=0644,dir_mode=0755,vers=3.0" //remotehost/share ~/localdir
2. Access directory via Dolphin
3. Attempt to access a file lacking a filename extension
4. Attempt to set an application association for a file lacking a filename extension

OBSERVED RESULT
The file's type is not being correctly displayed within Dolphin, and attempts to set application associations are not being registered.

EXPECTED RESULT
The file's type should be displayed irrespective of the filename extension, and applications associations should be registering correctly.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux - 6.8.2-zen2-1-zen (64-bit)
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
This bug was not present for me in Plasma 5.27--it occurred upon upgrading to Plasma 6.
Comment 1 DT 2024-03-31 02:27:33 UTC
Created attachment 167970 [details]
Okteta being selected as default application
Comment 2 DT 2024-04-21 22:16:07 UTC
I believe this bug might be related: https://bugs.kde.org/show_bug.cgi?id=484824
Comment 3 Maciej Stanczew 2024-04-30 17:31:48 UTC
Same behavior with NFS mounts; file types are detected correctly only through filename extensions, not file contents. This worked on Plasma 5.27 / Frameworks 5.115 / Dolphin 23.08.

In Interface → Previews there is an option "Skip previews for remote files above: …", but changing it doesn't have any effect on this issue.

> When attempting to open a file lacking a filename extension, "Okteta" is being defaulted to as the default application.
This probably means you have an association added for Okteta to open unknown files (application/octet-stream). I don't have such association, and all I get is the "Open With…" menu entry; and when clicking the file I get the "Choose Application" dialog.
Comment 4 DT 2024-05-01 00:00:57 UTC
(In reply to Maciej Stanczew from comment #3)

> > When attempting to open a file lacking a filename extension, "Okteta" is being defaulted to as the default application.
> This probably means you have an association added for Okteta to open unknown
> files (application/octet-stream). I don't have such association, and all I
> get is the "Open With…" menu entry; and when clicking the file I get the
> "Choose Application" dialog.

Yeah, this was the case. I was able to work around the issue somewhat by manually editing my mimeapps.list and setting kwrite as the default application for the application/octet-stream mimetype. This at least allows me to open plain text files lacking a file extension (or that have extensions that don't correspond to a mimetype, like .conf or .nix files), which for me, was the usecase most affected by the bug. But, this is an inadequate solution for, say, opening pictures or videos lacking the appropriate extension.