EtalumaSupport / LumaViewPro

MIT License
6 stars 6 forks source link

We currently allow illegal characters in file names #364

Open ericweiner opened 6 months ago

ericweiner commented 6 months ago

v 1.8 app release.

We had a user who was getting zero-length files when she named the individual steps in a protocol with a colon. (i.e. 1:1, 1:2, etc.)

We should validate all user-requested filenames to make sure that they are legal.

https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file

There's also a good list here towards the bottom: https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names

ericweiner commented 6 months ago

actually that list at the end has a lot of perfectly valid characters in it...

Maybe just this:

Find all files and folders with any of these Windows-illegal characters in

their name: \ : * ? " < > |

find . -name '[\:*?\"<>|]'

We should probably also check to make sure it won't go over 256 characters in the total path, if that is possible/easy.

jmcoreymv commented 5 months ago

Needs verification on the feature/imagej branch.