(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
This commit is contained in:
Sitaram Chamarty 2010-09-06 10:34:21 +05:30
parent b6c93c7ce8
commit 595410aa55
2 changed files with 1 additions and 13 deletions

View file

@ -22,18 +22,6 @@ In this document:
`~/.netrc` file and making it `chmod 600`. Anyway, http based access is `~/.netrc` file and making it `chmod 600`. Anyway, http based access is
inherently less secure than pubkeys so not much point worrying about it. 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 * 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 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 because `$HOME` is not defined or in the wrong place; manually set

View file

@ -242,7 +242,7 @@ sub where_is_rc
$SIG{__DIE__} = sub { $SIG{__DIE__} = sub {
my $msg = shift; chomp($msg); 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 "$msg\r\n";
print STDERR "$msg\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 ;-) exit 0; # if it's ok for die_webcgi in git.git/http-backend.c, it's ok for me ;-)