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

bjoe...@arcor.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #12 from bjoe...@arcor.de ---
The strategy is good, but does not reliable work on Linux.

    if (sysType.contains(QLatin1String("FAT")) ||
        sysType.contains(QLatin1String("NTFS")))
    {
        QRegExp regexp(QLatin1String("[?*<>,\\+:=/\";|]"));
        newName.replace(regexp, QLatin1String("_"));
    }

The current code tests for the filesystems "FAT" and "NTFS". On Linux "FAT"
filesystems show the name "vfat" in QStorageInfo. NTFS shows as "fuseblk" in
QStorageInfo, if NTFS is mounted with "ntfs-3g" like most distributions do.
Unfortunately "fuseblk" does not necessarily mean, the it is a NTFS filesystem.
There are many FUSE filesystems.

"vfat" is OK, because "FAT" matches the uppercase word "VFAT". For NTFS
(ntfs-3g) we need a solution. (Hint: "lsblk -no name,fstype" detects NTFS
correctly - see
https://unix.stackexchange.com/questions/332712/how-do-i-find-out-what-filesystem-fuse-is-using)

I also do not understand, why "/" is not filtered on Linux. \ / : * ? " < > |
are legal characters in Linux filenames (only / and NUL are illegal), but will
cause problems anyway, e.g. in the shell.

ReFS and exFAT are also not considered by the code.

The easiest solution is still to filter all possible illegal characters
unconditionally.

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

Reply via email to