Ignore:
Timestamp:
Apr 29, 2011, 9:15:06 PM (13 years ago)
Author:
andersk
Message:
ldapize: Give a custom error for unknown git vhosts

The previous commit changed the error message on unknown git vhosts
from this (caused by a mangled Perl backtrace):
  fatal: protocol error: bad line length character: Can'
to the message provided by upstream:
  fatal: The remote end hung up unexpectedly

This further changes the error message to the custom
  fatal: remote error: No such host nonexistent.scripts.mit.edu

I do not personally support this commit, because this just isn’t a
common problem, and using the upstream message was a good enough
improvement.  However, it is included by demand.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/oursrc/execsys/ldapize.pl

    r1823 r1824  
    5555  exec('/usr/sbin/suexec', $uidNumber, $gidNumber, '/usr/libexec/scripts-trusted/svn', "$scriptsdir/svn/$vhostDirectory");
    5656} elsif ($proto eq 'git') {
     57  if ($vhostEntry->get_value('scriptsVhostName') eq 'notfound.example.com') {
     58    # git-daemon doesn’t report useful errors yet
     59    my $msg = "ERR No such host $hostname\n";
     60    printf '%04x%s', length($msg) + 4, $msg;
     61    exit;
     62  }
    5763  chdir '/usr/libexec/scripts-trusted';
    5864  exec('/usr/sbin/suexec', $uidNumber, $gidNumber, '/usr/libexec/scripts-trusted/git', "$scriptsdir/git/$vhostDirectory");
Note: See TracChangeset for help on using the changeset viewer.