0

I'm trying to setup a GIT server, authenticated through LDAP. I am using Apache. The GIT client fails when trying to push.

git push

According to the server logs, the problem is with WebDAV PROPFIND command, which is not authenticated by GIT and end up with a 401 http code:

Apache access.log:

192.168.23.199 - - [13/Jul/2017:13:39:27 +0000] "GET /test.git/info/refs?service=git-receive-pack HTTP/1.1" 401 381
192.168.23.199 - johndoe [13/Jul/2017:13:39:27 +0000] "GET /test.git/info/refs?service=git-receive-pack HTTP/1.1" 200 59
192.168.23.199 - johndoe [13/Jul/2017:13:39:27 +0000] "GET /test.git/HEAD HTTP/1.1" 200 23
192.168.23.199 - - [13/Jul/2017:13:39:27 +0000] "PROPFIND /test.git/ HTTP/1.1" 401 381

My config file contains a LimitExcept:

   <Location />
        Dav on

        AuthBasicProvider ldap
        AuthLDAPURL "ldap://server:3268 server:3268 server:3268 server:3268/dc=mydc,dc=local?sAMAccountName,distinguishedName,memberOf,displayName"

        AuthLDAPBindDN "CN=documentation,OU=Script-Users,OU=Orange,DC=qconsulting,DC=local"
        AuthLDAPBindPassword "xxxxx"
        AuthType Basic
        AuthName "AD Authorization required"


        <LimitExcept PROPFIND>
            Require valid-user
        </LimitExcept>

        AllowOverride None

        Options FollowSymLinks Indexes
        RewriteEngine on
        RewriteRule ^pub/git$  /pub/git/cgi-bin/gitweb.cgi
        RewriteRule ^pub/git/$  /pub/git/cgi-bin/gitweb.cgi
        RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
     </Location>

The strange thing is that I tried to do PROPFIND request through curl and cadaver. And it fails with curl (401) and it succeeds with cadaver (207)

curl --request PROPFIND http://server/test.git/

Apache Log:

192.168.23.199 - - [13/Jul/2017:11:11:46 +0000] "PROPFIND /test.git/ HTTP/1.1" 207 436

cadaver http://server/test.git/

propnames /

192.168.23.199 - - [13/Jul/2017:11:11:59 +0000] "PROPFIND /test.git/ HTTP/1.1" 401 381
jcolot
  • 21
  • 5
  • There was [a bug in git](https://github.com/msysgit/msysgit/issues/116#issuecomment-51979630) that was fixed in version 2.0.3. What version do you use? – phd Jul 13 '17 at 17:55
  • I'm using GIT 1.8.3.1, it's the last available on RedHat 7. But there seems to be also a problem on Apache. I cannot get the Limit / LimitExcept to work for the PROPFIND method. It does seem to work for methods like GET / POST. I'm using Apache HTTPD 2.4.6. – jcolot Jul 13 '17 at 22:55

0 Answers0