CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd

Angus Turnbull angus at twinhelix.com
Mon Mar 7 10:07:51 CET 2011


> This is very strange. On you site, /cgit?r=fsmenu works as expected,
> while /cgit?url=fsmenu does not, and instead shows a path-filtered
> repolist (url=fsmenu is how $PATH_INFO is handled internally).
> 
> When specifying r=fsmenu, "fsmenu" is passed as argument to
> cgit_get_repoinfo() [1], and when specifying url=fsmenu, "fsmenu" is
> passed as argument to cgit_parse_url() [2], which in turn invokes
> cgit_get_repoinfo() [3] on its argument. This should Just Work.
> 
> If you could add a fprintf() to cgit_get_repoinfo() [4], like this
> 
>   fprintf(stderr, "cgit_get_repoinfo(%s)\n", url);
> 
> and report back what you get in your webserver logfiles when accessing
>   /cgit/fsmenu
>   /cgit?r=fsmenu
>   /cgit?url=fsmenu
> 
> That might help us pin down the cause of the problem.
> 
> --
> larsh
> 
> [1] http://hjemli.net/git/cgit/tree/cgit.c?h=stable#n206
> [2] http://hjemli.net/git/cgit/tree/cgit.c?h=stable#n211
> [3] http://hjemli.net/git/cgit/tree/parsing.c?h=stable#n26
> [4] http://hjemli.net/git/cgit/tree/shared.c?h=stable#n72

Thanks for the feedback. I've added the patch (pasted that as the first
line of the function), recompiled and discovered that Lighty doesn't use
the error log but redirects to STDOUT :). Anyway, results:

"/cgit/fsmenu"
cgit_get_repoinfo(fsmenu)

"/cgit/fsmenu/"
cgit_get_repoinfo(fsmenu/)
cgit_get_repoinfo(fsmenu)

"/cgit?r=fsmenu"
cgit_get_repoinfo(fsmenu)

"/cgit?url=fsmenu"
cgit_get_repoinfo(fsmenu)

The server is Ubuntu 10.04 x64, and I've tried compiling cgit on my
desktop which is 10.10 x64 against a fresh tarball of Git v1.7.3.5,
still the same result (where I ran the above tests actually). Perhaps
try an Ubuntu x64 virtual machine using something like KVM or VirtualBox
and see if you can spot the issue too? All my packages are from the
standard repos.

Angus





More information about the CGit mailing list