Hacker News new | ask | show | jobs
by hmottestad 3333 days ago
Makes me wonder if I can make a crate called "../.." and have it overwrite some user files.
2 comments

Crate identifiers are required to be [a-zA-Z] for the first character and [a-zA-Z0-9_-] for the rest. So, no. :P
More succinctly: [A-z]+[A-z0-9_-]
If you look closely at your comment, you'll realize the hilarious HN bug that prevents me from writing it as you suggest. :P

  [a-zA-Z][a-zA-Z0-9_-]*
FTFY
[A-z] is not the same as [A-Za-z] .

The former includes a few punctuation characters that are between "Z" and "a".

[\]^_` included, or is that a special case?
It looks like the files were managed by Git (see the output where the checkout errors out), so no that won't work.
I thought git handled the windows special file names. Am I misremembering or is it a difference (and thus a bug) in libgit2? (used by cargo, afaik)
I believe that git chokes by default on special file names on Windows, but I think there's a config variable that you can set to fix it. I don't know if libgit2 differs here.
Regular old git will fail; I tried to check out MINIX's source code a month ago and the clone failed since a file was named COM.