Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths

2016-10-21 Thread Jeff King
On Fri, Oct 21, 2016 at 11:23:53AM -0700, Junio C Hamano wrote: > A request to "git:///", depending on , results > in "directory" given to path_ok() in a bit different forms. Namely, > connect.c::parse_connect_url() gives > > URL directory >

Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths

2016-10-21 Thread Junio C Hamano
Junio C Hamano writes: > Duy Nguyen writes: > >> The amount of changes is unbelievable for fixing such a rare case >> though. I wonder if we can just detect this in daemon.c and pass >> "./~foo/bar" instead of "~foo/bar" to enter_repo() in non-strict mode

Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths

2016-10-21 Thread Junio C Hamano
Duy Nguyen writes: > The amount of changes is unbelievable for fixing such a rare case > though. I wonder if we can just detect this in daemon.c and pass > "./~foo/bar" instead of "~foo/bar" to enter_repo() in non-strict mode > to "disable" expand_user_path(). If it works,

Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths

2016-10-19 Thread Duy Nguyen
On Wed, Oct 19, 2016 at 1:05 AM, Luke Shumaker wrote: >> I am not sure if it is even a bug. As you can easily lose that >> tilde that appears in front of subdirectory of /srv/git/ or replace >> it with something else (e.g. "u/"), this smells like "Don't do it if >> it

Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths

2016-10-18 Thread Luke Shumaker
On Tue, 18 Oct 2016 13:08:45 -0400, Junio C Hamano wrote: > > Luke Shumaker writes: > > > The superficial aspect of this change is that git-daemon now allows paths > > that start with a "~". Previously, if git-daemon was run with > > "--base-path=/srv/git", it was

Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths

2016-10-18 Thread Junio C Hamano
Luke Shumaker writes: > The superficial aspect of this change is that git-daemon now allows paths > that start with a "~". Previously, if git-daemon was run with > "--base-path=/srv/git", it was impossible to get it to serve > "/srv/git/~foo/bar.git". I am not sure I

[PATCH] daemon, path.c: fix a bug with ~ in repo paths

2016-10-18 Thread Luke Shumaker
The superficial aspect of this change is that git-daemon now allows paths that start with a "~". Previously, if git-daemon was run with "--base-path=/srv/git", it was impossible to get it to serve "/srv/git/~foo/bar.git". An odd edge-case that was broken. But from a source-code standpoint, the