Re: [PATCH 1/5] Library code for user-relative paths, take three.
- From
- H. Peter Anvin <hpa@zytor.com>
- Date
- Nov 18, 2005, 20:33 UTC
- Message-ID
- <437E3A9B.1070801@zytor.com>
- In-Reply-To
- <437DA828.6020207@op5.se>
Andreas Ericsson wrote:
Show 17 quoted lines
> Junio C Hamano wrote:
>
>>
>>> + /* This is perfectly safe, and people tend to think of the
>>> directory
>>> + * where they ran git-init-db as their repository, so humour
>>> them. */
>>> + (void)chdir(".git");
>>
>>
>> It might be safe, but I think it changes the behaviour of
>> upload-pack with strict case. My gut reaction is we would want
>> "if (!strict)" in front. Thoughts?
>
> As it says in the comment; People tend to think of the directory where
> they ran "git init-db" as their repository, so humour them. It's nice
> for sharing files between devs in the office, and it *is* safe.No, it's not.
The whole point with --strict is that it shouldn't DWIM. DWIMming is *NOT* safe if the data has previously passed through a security screen.
Don't DWIM in strict mode, ever. If you do, you create security holes. If not immediately, then later.
-hpa