Bug 414478 - User Should definitely be warned every time an Invalid filename is used!
Summary: User Should definitely be warned every time an Invalid filename is used!
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 19.08.2
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-25 01:04 UTC by jc_josue3773
Modified: 2024-04-28 01:09 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jc_josue3773 2019-11-25 01:04:55 UTC
Always!But specially when copying or creating files in a NTFS filesystem shared with Windows. 
My experience is that it can indeed lead to data loss!
But why? Even if the NTFS file system doesn't usually accept those files being created, Linux usually allows them to copied to such partition or even worse, to be created, and nothing seems to happen, nothing seems to go wrong. But that's not the reality.

The case is that I had the problem with those files. If that NTFS partition ever needs to be checked with chkdsk any and all files that had invalid filenames will go into the brink of being wiped. Granted that if all of them do appear in the recovered found.000 folders, they will appear with a numerical name and a .chk extension. If you happen to have created too many invalid files like I did (and I tried to avoid it, mind you) you will have to go over quite a high number of files (and folders!) that have lost their meaning because you don't know where they belong and they lack a proper filename! And it is not uncommon for Windows to prompt you to check external drives! 

Now the trick here is what happens when you have a huge disk with lots of files and folders and some files start giving "unreadable" or "read access" errors! You must run chkdsk! The disk is just fine, but those invalid files seem to be causing the problem when there are too many of them, as they are shown as offenders in the chkdsk report! 
 

The following reserved characters:

    < (less than)
    > (greater than)
    : (colon)
    " (double quote)
    / (forward slash)
    \ (backslash)
    | (vertical bar or pipe)
    ? (question mark)
    * (asterisk)

Linux DOESNT forbid you from creating invalid filenames even on a NTFS filesystem that is shared with Windows!
If you want to make a map named Dark Archons : the gathering the : character will make that file go wrong on Windows,  If you copy the file to an external HDD with NTFS it will NOT give any warnings either!!!

https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names

Dolphin should definitely give a WARNING message when dealing with files that have this kind of characters!
I could even create files with * | / ? or \  or even the line break (intro) character! 

--------------------------------------------------------------
SUMMARY

User Should definitely be warned every time an Invalid filename is used when it comes to copying or creating a file!

Always!


BTW I really think we must put pressure so Microsoft Open Sources NTFS just as they did with FAT32.



STEPS TO REPRODUCE
1. right click and select create new file or folder
2. type any sort of garbage name, even with * /  \ or even |  
3. cut or copy the file anywhere! (specially NTFS partitions)

OBSERVED RESULT

No warning, no notice, you could loose those files without ever noticing!

EXPECTED RESULT

A propper warning should be given, even if mass copying. 
This should be treated in the same way as when you have duplicated filenames, Dolphin should allow renaming the offending file or folder! 
It would be even better if it suggests a filename removing the offending characters or even better if (when mass copying) there was an option to review all the offending files (with a location list) later.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Manjaro KDE Juhraya 18.1.3
(available in About System)
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.2

ADDITIONAL INFORMATION

Please notice that I'm not asking for this to become impossible, I'm just asking for a proper optional warning and to have a way for the user to manage the problem. 

I have had this problem both using Manjaro KDE and the older Linux Mint KDE (18.3)
Comment 1 gerrytrevis@gmail.com 2019-12-14 21:41:28 UTC
I have a path names with a colon and it brings up errors that the clips are invalid and the rendered files are invalid and it has taken days to figure out this problem. We should get an error message right away.
Comment 2 jc_josue3773 2019-12-14 23:26:36 UTC
I don't understand why the product has beeb changed to KDENLIVE 
It was DOLPHIN Oh god why?
Comment 3 jc_josue3773 2020-01-09 00:04:17 UTC
OK, clearly this bug is more general as it affects not just Dolphin but Kdenlive. So, what is needed is to fix it not just in Dolphin but on any other KDE software that is affected as well.
Comment 4 witchhunter 2021-02-06 12:17:24 UTC
Using Kubuntu 20.10 and this has been partially improved since Dolphin do throw an error - "Could not write to /path/" 
and Kate - "The document could not be saved, as it was not possible to write to /path/. Check that you have write access to this file or that enough disk space is available."

The problem is those alerts can be misleading and my first thought is - Windows didn't properly unmount it's drives. So there should be some check on given filenames and pop-up offering to strip invalid characters.

Furthermore, as stated in the link OP offered, there are some length restrictions to consider as well.
Comment 5 witchhunter 2021-10-12 16:56:29 UTC
TIL things are even worse. 
Dolphin clearly allows you to create a filename containing '/' (forward slash) on EXT4. 
1) Don't know what is the reasoning behind this witchcraft but this is only doing more harm than good.
2) With all due respect to KDE devs, but don't they show the same upstream, to EXT4 founders. This is just unprofessional.
3) More ironically Dolphin throws nice warning when you try to name a directory containing the forward slash sign. This is plane inconsistency.
Comment 6 witchhunter 2023-02-20 22:32:51 UTC
Can "windows_names" mount option in NTFS3 kernel driver ease the implementation here?

https://lore.kernel.org/lkml/3826a578-c371-bace-96a5-4e5dc83b5602@paragon-software.com/
Comment 7 myusualnickname@gmail.com 2024-04-28 01:09:50 UTC
It looks like a forward slash, but it is a replacement look alike character that we cannot type.

I  filed a bug for that in kde 4 but the bug was marked invalid because someone was proud of breaking our systems... adding a feature that they thought was cool.

It is worse than that, Case preserving case insensitive filesystems can clobber data if a new filename is made differing only by case.

It is worse than that, filenames can be anything other than null and forward slash.  So the escape sequence that messes with terminals can be sent.  Ever cat a binary file and have your terminal get messed up?  Well, we're living with a huge vulnerability in files like that.

Dolphin should flag files with harmful characters. Basically there should be a test to see if a file name is valid unicode, and then check for a list of banned characters. I would like this in the device driver/filesystem level on the system, but it requires communication with the user space.  Creating a file with the same name but different case should cause a problem.

This is a very severe problem that people just ignore.


(In reply to witchhunter from comment #5)
> TIL things are even worse. 
> Dolphin clearly allows you to create a filename containing '/' (forward
> slash) on EXT4. 
> 1) Don't know what is the reasoning behind this witchcraft but this is only
> doing more harm than good.
> 2) With all due respect to KDE devs, but don't they show the same upstream,
> to EXT4 founders. This is just unprofessional.
> 3) More ironically Dolphin throws nice warning when you try to name a
> directory containing the forward slash sign. This is plane inconsistency.