|
|
Subscribe / Log in / New account

Safename: restricting "dangerous" file names

Safename: restricting "dangerous" file names

Posted May 12, 2016 12:38 UTC (Thu) by robbe (guest, #16131)
Parent article: Safename: restricting "dangerous" file names

I was interested if there were any files on my desktop that would be forbidden.

I found two with CR at the end, two html files from boost’s documentation begin with a tilde (destructors?). Pretty harmless.

Files names with a dash as their first character are by far the most numerous. systemd’s usage of -.mount and -.slice will run into trouble under this module.


to post comments

Safename: restricting "dangerous" file names

Posted May 12, 2016 19:55 UTC (Thu) by error27 (subscriber, #8346) [Link] (2 responses)

I ran `find -name \[~-]\* 2> /dev/null` on my system.

I get 169 files.

The systemd files you mentioned.
Some downloaded javascript from when I saved a webpage in firefox
A bunch of files in format NAME-000-999 where the NAME part is missing.
2 auto-generated file from running trinity
A few files called "-1.jpg" or -1.png
-13-degree-weather-has-brought-chicagos-ohare-airport-to-a-n.jpg
A -.orig file that patch created by accident
13 files that originally came from Windows and start with ~$ like "~$hool Policies Manual.doc"

I'm in favour of this change but it could be slightly annoying to transition. Except for the minus one files, all the bad names look to be auto-generated. Some are generated by linux programs which can be fixed but a lot were auto-generated on someone else's system.

Safename: restricting "dangerous" file names

Posted May 12, 2016 22:38 UTC (Thu) by joey (guest, #328) [Link] (1 responses)

Leading and trailing spaces are also not unusual in file names. It's easy to not notice them when editing the name of a file in a desktop environment.

Safename: restricting "dangerous" file names

Posted May 21, 2016 20:30 UTC (Sat) by Wol (subscriber, #4433) [Link]

Especially when it's deliberate :-)

PI-Open used to create directories (which the OS was not supposed to muck about with the contents of) which contained a whole bunch of files, whose name format was <space><backspace><number>.

It did that because Pr1mos (from which it was ported) had "segmented directories". Basically, a directory with no space for the filename, so files had to be referenced by offset number. For the most part, those directories were meant for programs - each file was mapped to a memory segment when the program was loaded (hence "segmented directory"), but as programmers will, plenty of us found other good uses for them :-)

Cheers,
Wol


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds