Bug 481842

Summary: Dolphin allows creating or renaming to a filename containing "/"
Product: [Applications] dolphin Reporter: Jin Liu <ad.liu.jin>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: fanzhuyifan, kfm-devel
Priority: NOR Keywords: qt6
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jin Liu 2024-02-26 04:23:55 UTC
SUMMARY
E.g. a filename "a/b".
Linux kernel allows that, but it's difficult to handle the file in shells. E.g. "rm a/b" fails. ("rm *" works though)

STEPS TO REPRODUCE
1. Right click, New, Text file.
2. Enter "a/b".

OBSERVED RESULT
A file named "a/b" is created.

EXPECTED RESULT
Dolphin should not allow that name.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 fanzhuyifan 2024-02-26 16:24:38 UTC
Humm according to this stackoverflow answer, this should be forbidden by the filesystem, unless it is a character that looks like /.

https://stackoverflow.com/questions/9847288/is-it-possible-to-use-in-a-filename
Comment 2 fanzhuyifan 2024-02-26 16:26:01 UTC
Can reproduce on btrfs when creating text files (dolphin does the right thing and create subfolders when trying to create a new folder called a/b).
Comment 3 fanzhuyifan 2024-02-26 16:34:26 UTC
It is actually U+2044, which you can handle in bash. And that is done explicitly here: https://invent.kde.org/frameworks/kio/-/blob/master/src/core/global.cpp#L116

So I am going to call this intentional for now.