From 595410aa55315de10a11428887c74399970350c5 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 6 Sep 2010 10:34:21 +0530 Subject: [PATCH] (http) first level error reporting now works I didn't know that remote-curl.c requires 200 OK even if you want to report an error. With Ilari's patch at [1] you'll get a more readable message but it is still good enough now. [1]: http://permalink.gmane.org/gmane.comp.version-control.git/155464 --- doc/http-backend.mkd | 12 ------------ src/gitolite.pm | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/doc/http-backend.mkd b/doc/http-backend.mkd index fbc7300..cf1af10 100644 --- a/doc/http-backend.mkd +++ b/doc/http-backend.mkd @@ -22,18 +22,6 @@ In this document: `~/.netrc` file and making it `chmod 600`. Anyway, http based access is inherently less secure than pubkeys so not much point worrying about it. - * messages from first level errors (where gitolite's 'gl-auth-command' bombs - out without letting git even get control, due to inadequate access) don't - come to the user. The git client is swallowing up a perfectly good error - message -- you can see it if you manually retry like this: - - $ curl http://bob:bob@127.0.0.1/git/foo/alice/a1.git/info/refs?service=git-receive-pack - W access for foo/alice/a1 DENIED to bob - - What's worse, when this failure happens, the git client retries a few - other things, eventually ending up doing a `PROPFIND` webdav attempt so - you get a DAV error of some kind. - * I have not tested any of the ancillary standalone programs (like gl-dont-panic) in this mode. They're most likely going to crash and burn because `$HOME` is not defined or in the wrong place; manually set diff --git a/src/gitolite.pm b/src/gitolite.pm index 863683b..1a6ab6a 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -242,7 +242,7 @@ sub where_is_rc $SIG{__DIE__} = sub { my $msg = shift; chomp($msg); - &print_http_headers(500, "error - gitolite"); + &print_http_headers(); # remote-curl.c requires 200 OK even if you want to report an error print "$msg\r\n"; print STDERR "$msg\n"; exit 0; # if it's ok for die_webcgi in git.git/http-backend.c, it's ok for me ;-)