in reply to Filenames named "..\n"

Some inferior operating systems, including most based on Unix, allow all kinds of problems by allowing rediculous characters (everything but "\0" and "/", for example) in file names, leading to all manner of silly exploits and paranoid coding practices.

- tye        

Replies are listed 'Best First'.
Re^2: Filenames named "..\n" (unix)
by zzspectrez (Hermit) on Aug 02, 2005 at 06:01 UTC

    Given this, would it not be more of a feature to ignore a filename named "..\n" instead of a bug. If someone bothered to embed a "\n" in the filename I probably dont want to process it anyways!? :)

      Exploits often justify paranoia...

      You wouldn't want your script that looks for set-UID exploits to miss one because the cracker put it in a file named "..\n".

      - tye        

        true, true... In that case you want them all..

        If you have a cracker that can create set-UID exploits, the fact the file name has a newline in it is the least of your worries.
Re^2: Filenames named "..\n" (unix)
by Anonymous Monk on Aug 02, 2005 at 08:29 UTC
    Yeah, using whitespace in a filename can cause a problem for a sloppy programmer. That's why no (well, most) Unix users will never create such files. The only problems are caused by file systems that are cross mounted between Unix and Windows systems, with the Windows people created files with spaces in them.

    Curse them.

      No, curse the sloppy programmers who assumed users wouldn't want to use spaces in filenames. Blame the programmer. I was astonished and annoyed that I had to create a symlink from ~/My Video to ~/.MyVideo just so I could allow dvdrip to function. The dumb writer thought I shouldn't have spaces in my directories.