From: Junio C Hamano Date: Wed, 19 Oct 2005 01:18:42 GMT Subject: Re: [PATCH] git-daemon extra paranoia Message-ID: <7v3bmyl2x9.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <435596CB.6070401@zytor.com> "H. Peter Anvin" writes: > Consider the whitelist/blacklist scenario I described in the previous > email. You have: > > whitelist: /pub/scm > blacklist: /pub/scm/foo/bar.git > > If you can bypass the blacklist by using the pathname /pub/scm/foo/bar, > that's bad. I like the simplicity of the check Linus suggested. Given /pub/scm/fora/../foo/bar/, you would end up chdir() to /pub/scm/foo/bar.git and getcwd() would hit the blacklist entry. Which almost means that you do not even need path_ok() ;-).