1. 07 2月, 2019 1 次提交
  2. 18 1月, 2019 1 次提交
  3. 11 1月, 2019 1 次提交
  4. 29 6月, 2018 1 次提交
    • B
      upload-pack: test negotiation with changing repository · 3374292e
      Brandon Williams 提交于
      Add tests to check the behavior of fetching from a repository which
      changes between rounds of negotiation (for example, when different
      servers in a load-balancing agreement participate in the same stateless
      RPC negotiation). This forms a baseline of comparison to the ref-in-want
      functionality (which will be introduced to the client in subsequent
      commits), and ensures that subsequent commits do not change existing
      behavior.
      
      As part of this effort, a mechanism to substitute strings in a single
      HTTP response is added.
      Signed-off-by: NBrandon Williams <bmwill@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3374292e
  5. 05 1月, 2018 1 次提交
  6. 17 10月, 2017 1 次提交
  7. 01 3月, 2017 1 次提交
    • J
      http: attempt updating base URL only if no error · 8e27391a
      Jonathan Tan 提交于
      http.c supports HTTP redirects of the form
      
        http://foo/info/refs?service=git-upload-pack
        -> http://anything
        -> http://bar/info/refs?service=git-upload-pack
      
      (that is to say, as long as the Git part of the path and the query
      string is preserved in the final redirect destination, the intermediate
      steps can have any URL). However, if one of the intermediate steps
      results in an HTTP exception, a confusing "unable to update url base
      from redirection" message is printed instead of a Curl error message
      with the HTTP exception code.
      
      This was introduced by 2 commits. Commit c93c92f3 ("http: update base
      URLs when we see redirects", 2013-09-28) introduced a best-effort
      optimization that required checking if only the "base" part of the URL
      differed between the initial request and the final redirect destination,
      but it performed the check before any HTTP status checking was done. If
      something went wrong, the normal code path was still followed, so this
      did not cause any confusing error messages until commit 6628eb41 ("http:
      always update the base URL for redirects", 2016-12-06), which taught
      http to die if the non-"base" part of the URL differed.
      
      Therefore, teach http to check the HTTP status before attempting to
      check if only the "base" part of the URL differed. This commit teaches
      http_request_reauth to return early without updating options->base_url
      upon an error; the only invoker of this function that passes a non-NULL
      "options" is remote-curl.c (through "http_get_strbuf"), which only uses
      options->base_url for an informational message in the situations that
      this commit cares about (that is, when the return value is not HTTP_OK).
      
      The included test checks that the redirect scheme at the beginning of
      this commit message works, and that returning a 502 in the middle of the
      redirect scheme produces the correct result. Note that this is different
      from the test in commit 6628eb41 ("http: always update the base URL for
      redirects", 2016-12-06) in that this commit tests that a Git-shaped URL
      (http://.../info/refs?service=git-upload-pack) works, whereas commit
      6628eb41 tests that a non-Git-shaped URL
      (http://.../info/refs/foo?service=git-upload-pack) does not work (even
      though Git is processing that URL) and is an error that is fatal, not
      silently swallowed.
      Signed-off-by: NJonathan Tan <jonathantanmy@google.com>
      Acked-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e27391a
  8. 07 12月, 2016 2 次提交
    • J
      http: make redirects more obvious · 50d34137
      Jeff King 提交于
      We instruct curl to always follow HTTP redirects. This is
      convenient, but it creates opportunities for malicious
      servers to create confusing situations. For instance,
      imagine Alice is a git user with access to a private
      repository on Bob's server. Mallory runs her own server and
      wants to access objects from Bob's repository.
      
      Mallory may try a few tricks that involve asking Alice to
      clone from her, build on top, and then push the result:
      
        1. Mallory may simply redirect all fetch requests to Bob's
           server. Git will transparently follow those redirects
           and fetch Bob's history, which Alice may believe she
           got from Mallory. The subsequent push seems like it is
           just feeding Mallory back her own objects, but is
           actually leaking Bob's objects. There is nothing in
           git's output to indicate that Bob's repository was
           involved at all.
      
           The downside (for Mallory) of this attack is that Alice
           will have received Bob's entire repository, and is
           likely to notice that when building on top of it.
      
        2. If Mallory happens to know the sha1 of some object X in
           Bob's repository, she can instead build her own history
           that references that object. She then runs a dumb http
           server, and Alice's client will fetch each object
           individually. When it asks for X, Mallory redirects her
           to Bob's server. The end result is that Alice obtains
           objects from Bob, but they may be buried deep in
           history. Alice is less likely to notice.
      
      Both of these attacks are fairly hard to pull off. There's a
      social component in getting Mallory to convince Alice to
      work with her. Alice may be prompted for credentials in
      accessing Bob's repository (but not always, if she is using
      a credential helper that caches). Attack (1) requires a
      certain amount of obliviousness on Alice's part while making
      a new commit. Attack (2) requires that Mallory knows a sha1
      in Bob's repository, that Bob's server supports dumb http,
      and that the object in question is loose on Bob's server.
      
      But we can probably make things a bit more obvious without
      any loss of functionality. This patch does two things to
      that end.
      
      First, when we encounter a whole-repo redirect during the
      initial ref discovery, we now inform the user on stderr,
      making attack (1) much more obvious.
      
      Second, the decision to follow redirects is now
      configurable. The truly paranoid can set the new
      http.followRedirects to false to avoid any redirection
      entirely. But for a more practical default, we will disallow
      redirects only after the initial ref discovery. This is
      enough to thwart attacks similar to (2), while still
      allowing the common use of redirects at the repository
      level. Since c93c92f3 (http: update base URLs when we see
      redirects, 2013-09-28) we re-root all further requests from
      the redirect destination, which should generally mean that
      no further redirection is necessary.
      
      As an escape hatch, in case there really is a server that
      needs to redirect individual requests, the user can set
      http.followRedirects to "true" (and this can be done on a
      per-server basis via http.*.followRedirects config).
      Reported-by: NJann Horn <jannh@google.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      50d34137
    • J
      http: always update the base URL for redirects · 6628eb41
      Jeff King 提交于
      If a malicious server redirects the initial ref
      advertisement, it may be able to leak sha1s from other,
      unrelated servers that the client has access to. For
      example, imagine that Alice is a git user, she has access to
      a private repository on a server hosted by Bob, and Mallory
      runs a malicious server and wants to find out about Bob's
      private repository.
      
      Mallory asks Alice to clone an unrelated repository from her
      over HTTP. When Alice's client contacts Mallory's server for
      the initial ref advertisement, the server issues an HTTP
      redirect for Bob's server. Alice contacts Bob's server and
      gets the ref advertisement for the private repository. If
      there is anything to fetch, she then follows up by asking
      the server for one or more sha1 objects. But who is the
      server?
      
      If it is still Mallory's server, then Alice will leak the
      existence of those sha1s to her.
      
      Since commit c93c92f3 (http: update base URLs when we see
      redirects, 2013-09-28), the client usually rewrites the base
      URL such that all further requests will go to Bob's server.
      But this is done by textually matching the URL. If we were
      originally looking for "http://mallory/repo.git/info/refs",
      and we got pointed at "http://bob/other.git/info/refs", then
      we know that the right root is "http://bob/other.git".
      
      If the redirect appears to change more than just the root,
      we punt and continue to use the original server. E.g.,
      imagine the redirect adds a URL component that Bob's server
      will ignore, like "http://bob/other.git/info/refs?dummy=1".
      
      We can solve this by aborting in this case rather than
      silently continuing to use Mallory's server. In addition to
      protecting from sha1 leakage, it's arguably safer and more
      sane to refuse a confusing redirect like that in general.
      For example, part of the motivation in c93c92f3 is
      avoiding accidentally sending credentials over clear http,
      just to get a response that says "try again over https". So
      even in a non-malicious case, we'd prefer to err on the side
      of caution.
      
      The downside is that it's possible this will break a
      legitimate but complicated server-side redirection scheme.
      The setup given in the newly added test does work, but it's
      convoluted enough that we don't need to care about it. A
      more plausible case would be a server which redirects a
      request for "info/refs?service=git-upload-pack" to just
      "info/refs" (because it does not do smart HTTP, and for some
      reason really dislikes query parameters).  Right now we
      would transparently downgrade to dumb-http, but with this
      patch, we'd complain (and the user would have to set
      GIT_SMART_HTTP=0 to fetch).
      Reported-by: NJann Horn <jannh@google.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6628eb41
  9. 26 7月, 2016 1 次提交
    • E
      git svn: migrate tests to use lib-httpd · a8a5d251
      Eric Wong 提交于
      This allows us to use common test infrastructure and parallelize
      the tests.  For now, GIT_SVN_TEST_HTTPD=true needs to be set to
      enable the SVN HTTP tests because we reuse the same test cases
      for both file:// and http:// SVN repositories.  SVN_HTTPD_PORT
      is no longer honored.
      
      Tested under Apache 2.2 and 2.4 on Debian 7.x (wheezy) and
      8.x (jessie), respectively.
      
      Cc: Clemens Buchacher <drizzd@aon.at>
      Cc: Michael J Gruber <git@drmicha.warpmail.net>
      Signed-off-by: NEric Wong <e@80x24.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a8a5d251
  10. 11 5月, 2016 1 次提交
    • J
      tests: adjust the configuration for Apache 2.2 · f1f2b45b
      Johannes Schindelin 提交于
      Lars Schneider noticed that the configuration introduced to test the
      extra HTTP headers cannot be used with Apache 2.2 (which is still
      actively maintained, as pointed out by Junio Hamano).
      
      To let the tests pass with Apache 2.2 again, let's substitute the
      offending <RequireAll> and `expr` by using old school RewriteCond
      statements.
      
      As RewriteCond does not allow testing for *non*-matches, we simply match
      the desired case first and let it pass by marking the RewriteRule as
      '[L]' ("last rule, do not process any other matching RewriteRules after
      this"), and then have another RewriteRule that matches all other cases
      and lets them fail via '[F]' ("fail").
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Tested-by: NLars Schneider <larsxschneider@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f1f2b45b
  11. 28 4月, 2016 1 次提交
    • J
      http: support sending custom HTTP headers · 8cb01e2f
      Johannes Schindelin 提交于
      We introduce a way to send custom HTTP headers with all requests.
      
      This allows us, for example, to send an extra token from build agents
      for temporary access to private repositories. (This is the use case that
      triggered this patch.)
      
      This feature can be used like this:
      
      	git -c http.extraheader='Secret: sssh!' fetch $URL $REF
      
      Note that `curl_easy_setopt(..., CURLOPT_HTTPHEADER, ...)` takes only
      a single list, overriding any previous call. This means we have to
      collect _all_ of the headers we want to use into a single list, and
      feed it to cURL in one shot. Since we already unconditionally set a
      "pragma" header when initializing the curl handles, we can add our new
      headers to that list.
      
      For callers which override the default header list (like probe_rpc),
      we provide `http_copy_default_headers()` so they can do the same
      trick.
      
      Big thanks to Jeff King and Junio Hamano for their outstanding help and
      patient reviews.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Reviewed-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8cb01e2f
  12. 19 3月, 2016 1 次提交
    • J
      t/lib-httpd: pass through GIT_CONFIG_NOSYSTEM env · 1fad5033
      Jeff King 提交于
      We set GIT_CONFIG_NOSYSTEM in our test scripts so that we do
      not accidentally read /etc/gitconfig and have it influence
      the outcome of the tests. But when running smart-http tests,
      Apache will clean the environment, including this variable,
      and the "server" side of our http operations will read it.
      
      You can see this breakage by doing something like:
      
        make
        ./git config --system http.getanyfile false
        make test
      
      which will cause t5561 to fail when it tests the
      fallback-to-dumb operation.
      
      We can fix this by instructing Apache to pass through the
      variable. Unlike with other variables (e.g., 89c57ab3's
      GIT_TRACE), we don't need to set a dummy value to prevent
      warnings from Apache. test-lib.sh already makes sure that
      GIT_CONFIG_NOSYSTEM is set and exported.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1fad5033
  13. 26 2月, 2016 1 次提交
    • M
      t/lib-httpd: load mod_unixd · 59223223
      Michael J Gruber 提交于
      In contrast to apache 2.2, apache 2.4 does not load mod_unixd in its
      default configuration (because there are choices). Thus, with the
      current config, apache 2.4.10 will not be started and the httpd tests
      will not run on distros with default apache config (RedHat type).
      
      Enable mod_unixd to make the httpd tests run. This does not affect
      distros negatively which have that config already in their default
      (Debian type). httpd tests will run on these before and after this patch.
      Signed-off-by: NMichael J Gruber <git@drmicha.warpmail.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      59223223
  14. 26 9月, 2015 2 次提交
    • B
      http: limit redirection depth · b2581164
      Blake Burkhart 提交于
      By default, libcurl will follow circular http redirects
      forever. Let's put a cap on this so that somebody who can
      trigger an automated fetch of an arbitrary repository (e.g.,
      for CI) cannot convince git to loop infinitely.
      
      The value chosen is 20, which is the same default that
      Firefox uses.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b2581164
    • B
      http: limit redirection to protocol-whitelist · f4113cac
      Blake Burkhart 提交于
      Previously, libcurl would follow redirection to any protocol
      it was compiled for support with. This is desirable to allow
      redirection from HTTP to HTTPS. However, it would even
      successfully allow redirection from HTTP to SFTP, a protocol
      that git does not otherwise support at all. Furthermore
      git's new protocol-whitelisting could be bypassed by
      following a redirect within the remote helper, as it was
      only enforced at transport selection time.
      
      This patch limits redirects within libcurl to HTTP, HTTPS,
      FTP and FTPS. If there is a protocol-whitelist present, this
      list is limited to those also allowed by the whitelist. As
      redirection happens from within libcurl, it is impossible
      for an HTTP redirect to a protocol implemented within
      another remote helper.
      
      When the curl version git was compiled with is too old to
      support restrictions on protocol redirection, we warn the
      user if GIT_ALLOW_PROTOCOL restrictions were requested. This
      is a little inaccurate, as even without that variable in the
      environment, we would still restrict SFTP, etc, and we do
      not warn in that case. But anything else means we would
      literally warn every time git accesses an http remote.
      
      This commit includes a test, but it is not as robust as we
      would hope. It redirects an http request to ftp, and checks
      that curl complained about the protocol, which means that we
      are relying on curl's specific error message to know what
      happened. Ideally we would redirect to a working ftp server
      and confirm that we can clone without protocol restrictions,
      and not with them. But we do not have a portable way of
      providing an ftp server, nor any other protocol that curl
      supports (https is the closest, but we would have to deal
      with certificates).
      
      [jk: added test and version warning]
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f4113cac
  15. 13 3月, 2015 1 次提交
  16. 12 12月, 2014 1 次提交
    • J
      t: support clang/gcc AddressSanitizer · b0f4c908
      Jeff King 提交于
      When git is compiled with "-fsanitize=address" (using clang
      or gcc >= 4.8), all invocations of git will check for buffer
      overflows. This is similar to running with valgrind, except
      that it is more thorough (because of the compiler support,
      function-local buffers can be checked, too) and runs much
      faster (making it much less painful to run the whole test
      suite with the checks turned on).
      
      Unlike valgrind, the magic happens at compile-time, so we
      don't need the same infrastructure in the test suite that we
      did to support --valgrind. But there are two things we can
      help with:
      
        1. On some platforms, the leak-detector is on by default,
           and causes every invocation of "git init" (and thus
           every test script) to fail. Since running git with
           the leak detector is pointless, let's shut it off
           automatically in the tests, unless the user has already
           configured it.
      
        2. When apache runs a CGI, it clears the environment of
           unknown variables. This means that the $ASAN_OPTIONS
           config doesn't make it to git-http-backend, and it
           dies due to the leak detector. Let's mark the variable
           as OK for apache to pass.
      
      With these two changes, running
      
          make CC=clang CFLAGS=-fsanitize=address test
      
      works out of the box.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b0f4c908
  17. 18 9月, 2014 1 次提交
    • J
      signed push: teach smart-HTTP to pass "git push --signed" around · 0ea47f9d
      Junio C Hamano 提交于
      The "--signed" option received by "git push" is first passed to the
      transport layer, which the native transport directly uses to notice
      that a push certificate needs to be sent.  When the transport-helper
      is involved, however, the option needs to be told to the helper with
      set_helper_option(), and the helper needs to take necessary action.
      For the smart-HTTP helper, the "necessary action" involves spawning
      the "git send-pack" subprocess with the "--signed" option.
      
      Once the above all gets wired in, the smart-HTTP transport now can
      use the push certificate mechanism to authenticate its pushes.
      
      Add a test that is modeled after tests for the native transport in
      t5534-push-signed.sh to t5541-http-push-smart.sh.  Update the test
      Apache configuration to pass GNUPGHOME environment variable through.
      As PassEnv would trigger warnings for an environment variable that
      is not set, export it from test-lib.sh set to a harmless value when
      GnuPG is not being used in the tests.
      
      Note that the added test is deliberately loose and does not check
      the nonce in this step.  This is because the stateless RPC mode is
      inevitably flaky and a nonce that comes back in the actual push
      processing is one issued by a different process; if the two
      interactions with the server crossed a second boundary, the nonces
      will not match and such a check will fail.  A later patch in the
      series will work around this shortcoming.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0ea47f9d
  18. 24 5月, 2014 1 次提交
  19. 15 10月, 2013 1 次提交
    • J
      remote-curl: rewrite base url from info/refs redirects · 050ef365
      Jeff King 提交于
      For efficiency and security reasons, an earlier commit in
      this series taught http_get_* to re-write the base url based
      on redirections we saw while making a specific request.
      
      This commit wires that option into the info/refs request,
      meaning that a redirect from
      
          http://example.com/foo.git/info/refs
      
      to
      
          https://example.com/bar.git/info/refs
      
      will behave as if "https://example.com/bar.git" had been
      provided to git in the first place.
      
      The tests bear some explanation. We introduce two new
      hierearchies into the httpd test config:
      
        1. Requests to /smart-redir-limited will work only for the
           initial info/refs request, but not any subsequent
           requests. As a result, we can confirm whether the
           client is re-rooting its requests after the initial
           contact, since otherwise it will fail (it will ask for
           "repo.git/git-upload-pack", which is not redirected).
      
        2. Requests to smart-redir-auth will redirect, and require
           auth after the redirection. Since we are using the
           redirected base for further requests, we also update
           the credential struct, in order not to mislead the user
           (or credential helpers) about which credential is
           needed. We can therefore check the GIT_ASKPASS prompts
           to make sure we are prompting for the new location.
           Because we have neither multiple servers nor https
           support in our test setup, we can only redirect between
           paths, meaning we need to turn on
           credential.useHttpPath to see the difference.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      050ef365
  20. 31 7月, 2013 1 次提交
  21. 22 6月, 2013 1 次提交
  22. 15 6月, 2013 4 次提交
  23. 14 4月, 2013 1 次提交
    • J
      doc/http-backend: match query-string in apache half-auth example · b0808819
      Jeff King 提交于
      When setting up a "half-auth" repository in which reads can
      be done anonymously but writes require authentication, it is
      best if the server can require authentication for both the
      ref advertisement and the actual receive-pack POSTs. This
      alleviates the need for the admin to set http.receivepack in
      the repositories, and means that the client is challenged
      for credentials immediately, instead of partway through the
      push process (and git clients older than v1.7.11.7 had
      trouble handling these challenges).
      
      Since detecting a push during the ref advertisement requires
      matching the query string, and this is non-trivial to do in
      Apache, we have traditionally punted and instructed users to
      just protect "/git-receive-pack$".  This patch provides the
      mod_rewrite recipe to actually match the ref advertisement,
      which is preferred.
      
      While we're at it, let's add the recipe to our test scripts
      so that we can be sure that it works, and doesn't get broken
      (either by our changes or by changes in Apache).
      Signed-off-by: NJeff King <peff@peff.net>
      Acked-by: NJakub Narębski <jnareb@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b0808819
  24. 10 4月, 2013 1 次提交
  25. 05 2月, 2013 1 次提交
    • S
      Verify Content-Type from smart HTTP servers · 4656bf47
      Shawn Pearce 提交于
      Before parsing a suspected smart-HTTP response verify the returned
      Content-Type matches the standard. This protects a client from
      attempting to process a payload that smells like a smart-HTTP
      server response.
      
      JGit has been doing this check on all responses since the dawn of
      time. I mistakenly failed to include it in git-core when smart HTTP
      was introduced. At the time I didn't know how to get the Content-Type
      from libcurl. I punted, meant to circle back and fix this, and just
      plain forgot about it.
      Signed-off-by: NShawn Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4656bf47
  26. 31 10月, 2012 1 次提交
    • J
      remote-curl: retry failed requests for auth even with gzip · 2e736fd5
      Jeff King 提交于
      Commit b81401c1 taught the post_rpc function to retry the
      http request after prompting for credentials. However, it
      did not handle two cases:
      
        1. If we have a large request, we do not retry. That's OK,
           since we would have sent a probe (with retry) already.
      
        2. If we are gzipping the request, we do not retry. That
           was considered OK, because the intended use was for
           push (e.g., listing refs is OK, but actually pushing
           objects is not), and we never gzip on push.
      
      This patch teaches post_rpc to retry even a gzipped request.
      This has two advantages:
      
        1. It is possible to configure a "half-auth" state for
           fetching, where the set of refs and their sha1s are
           advertised, but one cannot actually fetch objects.
      
           This is not a recommended configuration, as it leaks
           some information about what is in the repository (e.g.,
           an attacker can try brute-forcing possible content in
           your repository and checking whether it matches your
           branch sha1). However, it can be slightly more
           convenient, since a no-op fetch will not require a
           password at all.
      
        2. It future-proofs us should we decide to ever gzip more
           requests.
      Signed-off-by: NJeff King <peff@peff.net>
      2e736fd5
  27. 28 8月, 2012 3 次提交
    • J
      t: test http access to "half-auth" repositories · 4c71009d
      Jeff King 提交于
      Some sites set up http access to repositories such that
      fetching is anonymous and unauthenticated, but pushing is
      authenticated. While there are multiple ways to do this, the
      technique advertised in the git-http-backend manpage is to
      block access to locations matching "/git-receive-pack$".
      
      Let's emulate that advice in our test setup, which makes it
      clear that this advice does not actually work.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4c71009d
    • J
      t/lib-httpd: recognize */smart/* repos as smart-http · 666aae9a
      Jeff King 提交于
      We do not currently test authentication for smart-http repos
      at all. Part of the infrastructure to do this is recognizing
      that auth/smart is indeed a smart-http repo.
      
      The current apache config recognizes only "^/smart/*" as
      smart-http. Let's instead treat anything with /smart/ in the
      URL as smart-http. This is obviously a stupid thing to do
      for a real production site, but for our test suite we know
      that our repositories will not have this magic string in the
      name.
      
      Note that we will route /foo/smart/bar.git directly to
      git-http-backend/bar.git; in other words, everything before
      the "/smart/" is irrelevant to finding the repo on disk (but
      may impact apache config, for example by triggering auth
      checks).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      666aae9a
    • J
      t/lib-httpd: only route auth/dumb to dumb repos · 05b57710
      Jeff King 提交于
      Our test apache config points all of auth/ directly to the
      on-disk repositories via an Alias directive. This works fine
      because everything authenticated is currently in auth/dumb,
      which is a subset.  However, this would conflict with a
      ScriptAlias for auth/smart (which will come in future
      patches), so let's narrow the Alias.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      05b57710
  28. 25 7月, 2012 1 次提交
    • J
      t/lib-httpd: handle running under --valgrind · f6288254
      Jeff King 提交于
      Running the http tests with valgrind does not work for two
      reasons:
      
        1. Apache complains about following the symbolic link from
           git-http-backend to valgrind.sh.
      
        2. Apache does not pass through the GIT_VALGRIND variable
           to the backend CGI.
      
      This patch fixes both problems. Unfortunately, there is a
      slight hack we need to handle passing environment variables
      through Apache. If we just tell it:
      
        PassEnv GIT_VALGRIND
      
      then Apache will complain when GIT_VALGRIND is not set. If
      we try:
      
        SetEnv GIT_VALGRIND ${GIT_VALGRIND}
      
      then when GIT_VALGRIND is not set, it will pass through the
      literal "${GIT_VALGRIND}". Instead, we now unconditionally
      pass through GIT_VALGRIND from lib-httpd.sh into apache,
      even if it is empty.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f6288254
  29. 31 3月, 2012 1 次提交
    • J
      http-backend: respect existing GIT_COMMITTER_* variables · e32a4581
      Jeff King 提交于
      The http-backend program sets default GIT_COMMITTER_NAME and
      GIT_COMMITTER_EMAIL variables based on the REMOTE_USER and
      REMOTE_ADDR variables provided by the webserver. However, it
      unconditionally overwrites any existing GIT_COMMITTER
      variables, which may have been customized by site-specific
      code in the webserver (or in a script wrapping http-backend).
      
      Let's leave those variables intact if they already exist,
      assuming that any such configuration was intentional. There
      is a slight chance of a regression if somebody has set
      GIT_COMMITTER_* for the entire webserver, not intending it
      to leak through http-backend. We could protect against this
      by passing the information in alternate variables.  However,
      it seems unlikely that anyone will care about that
      regression, and there is value in the simplicity of using
      the common variable names that are used elsewhere in git.
      
      While we're tweaking the environment-handling in
      http-backend, let's switch it to use argv_array to handle
      the list of variables. That makes the memory management much
      simpler.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e32a4581
  30. 14 12月, 2011 1 次提交
    • J
      t5540: test DAV push with authentication · 0521710a
      Jeff King 提交于
      We don't currently test this case at all, and instead just
      test the DAV mechanism over an unauthenticated push. That
      isn't very realistic, as most people will want to
      authenticate pushes.
      
      Two of the tests expect_failure as they reveal bugs:
      
        1. Pushing without a username in the URL fails to ask for
           credentials when we get an HTTP 401. This has always
           been the case, but it would be nice if it worked like
           smart-http.
      
        2. Pushing with a username fails to ask for the password
           since 986bbc08 (http: don't always prompt for password,
           2011-11-04). This is a severe regression in v1.7.8, as
           authenticated push-over-DAV is now totally unusable
           unless you have credentials in your .netrc.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0521710a
  31. 18 11月, 2010 1 次提交
  32. 28 9月, 2010 1 次提交
  33. 06 1月, 2010 1 次提交