News for hackers. Stuff that matters.
Re:Why "ls *.c" is at least dumb, and possibly dangerous by tptacek on Friday October 09, 2009 @12:34AM (#870641)
You aren't going to create a file with a newline in the name. The person who wants to totally screw you over is going to create the file with the newline in the name.
Re:Why "ls *.c" is at least dumb, and possibly dangerous by yan on Friday October 09, 2009 @12:49AM (#870659)
I realize that. The example he used was a collection of c files, leading me to believe he was showing a personal collection of source as an example, wrongly or rightly. And I realize you aren't going to be creating files with newlines in them (or leading dashes, or many dots, etc), but once you get into a territory of someone being able to do that, and you're not competing in a CTF, I'd say there are larger issues to deal with.
Re:Why "ls *.c" is at least dumb, and possibly dangerous by basugasubaku on Friday October 09, 2009 @01:17AM (#870690)
I can do no better than quote Randal himself again, from the same thread:

"Well, there was a very embarassing error for Apple a few years ago for the 10.3 to 10.4 upgrade as I recall. Apparently, if you had a space in your home disk name, all sorts of files got deleted.

So, the moral is, no matter how rare you think something is, that's NO EXCUSE for not doing the right thing for all possible characters."

http://groups.google.com/group/comp.unix.shell/msg/504a75cc7... http://groups.google.com/group/comp.unix.shell/msg/0385fc2d1...

Re:Why "ls *.c" is at least dumb, and possibly dangerous by nailer on Friday October 09, 2009 @02:13AM (#870739)
Spaces in names are not rare - space is part of natural language, a filename or volume name in considered to be a single line label.