CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd

Lars Hjemli hjemli at gmail.com
Thu Mar 10 16:52:46 CET 2011


On Mon, Mar 7, 2011 at 10:07, Angus Turnbull <angus at twinhelix.com> wrote:
>> 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.
>
> 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)

Even more strange (I was hoping to see some munging of query params
due to url rewriting or some such). But with identical input, you
should get identical output (ctx->repo should point at the correct
repo-struct in all the above cases), so I assume that ctx->repo
somehow becomes NULL after the call to cgit_get_repoinfo(), but only
when initialized via cgit_parse_url().

Could you try running cgit under gdb to find the culprit? E.g:

$ PATH_INFO=fsmenu gdb ./cgit
(gdb) break cgit_parse_url
(gdb) run

-- 
larsh




More information about the CGit mailing list