Comment by chasil
4 years ago
Oh, my young friend, you have no idea what POSIX has done to you.
"While no one sane would put newlines in directory names, such corruption of the results could lead to exploitable vulnerabilities in scripts."
4 years ago
Oh, my young friend, you have no idea what POSIX has done to you.
"While no one sane would put newlines in directory names, such corruption of the results could lead to exploitable vulnerabilities in scripts."
He he.
Want to see true craziness? POSIX file names are just a bag of bytes. They don't even have to be text, they can be anything (almost), there's no standard text encoding:
https://lwn.net/Articles/325304/
And in typical Open Source fashion, someone actually claims it's a feature: https://lwn.net/Articles/325398/ because hey, you 99.999% percenters can suffer so that I, 0.001% percenter can implement my wacky system.
https://xkcd.com/1172/
This appears to demonstrate the full range of abuse.
Just because you can do something does not mean that you should.
It's software. Software's contract is the same as a legal contract. And a legal contract mostly says what you can't do.
So anything not directly blocked by the software is allowed.
Ergo, clear specifications, strict yet flexible types and APIs, etc.
Otherwise, it's just bad design.
It's basically the same on Windows with NTFS. Just a bag of 16-bit words instead of bytes.