git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] Revert "remote-curl: fall back to basic auth if Negotiate fails"

From
Derrick Stolee <stolee@gmail.com>
Date
May 19, 2021, 13:58 UTC
Message-ID
<43035278-5742-607a-57bd-971685deece8@gmail.com>
In-Reply-To
<YKNeXq3JzxYWkxKl@coredump.intra.peff.net>
On 5/18/2021 2:27 AM, Jeff King wrote:
Show 19 quoted lines
> This reverts commit 1b0d9545bb85912a16b367229d414f55d140d3be.
> 
> That commit does fix the situation it intended to (avoiding Negotiate
> even when the credentials were provided in the URL), but it creates a
> more serious regression: we now never hit the conditional for "we had a
> username and password, tried them, but the server still gave us a 401".
> That has two bad effects:
> 
>  1. we never call credential_reject(), and thus a bogus credential
>     stored by a helper will live on forever
> 
>  2. we never return HTTP_NOAUTH, so the error message the user gets is
>     "The requested URL returned error: 401", instead of "Authentication
>     failed".
> 
> Doing this correctly seems non-trivial, as we don't know whether the
> Negotiate auth was a problem. Since this is a regression in the upcoming
> v2.23.0 release (for which we're in -rc0), let's revert for now and work
> on a fix separately.
I think the revert is sufficiently justified here.
 
> (Note that this isn't a pure revert; the previous commit added a test
> showing the regression, so we can now flip it to expect_success).

Keeping the test is excellent, because it gives us a way to confirm that a second attempt at a fix is at least as good as the first.

The only thing that could improve this situation is to add a test that checks the bug that the previous version introduced, so that the next round doesn't repeat the mistake. That can be deferred because it is more important that we get this fix in time for the next release candidate.

Thanks, -Stolee

Previous: Jeff KingNext: Jeff King
Message 6 of 11 in “Git 2.23.0-rc0 HTTP authentication failure - error message change”
  1. Ben HumphreysMay 18, 2021
  2. Jeff KingMay 18, 2021
  3. 0/2 fix v2.32.0-rc0 bug with Negotiate / HTTP_NOAUTHJeff King, May 18, 2021
  4. 1/2 t5551: test http interaction with credential helpersJeff King, May 18, 2021
  5. 2/2 Revert "remote-curl: fall back to basic auth if Negotiate fails"Jeff King, May 18, 2021
  6. Derrick StoleeMay 19, 2021
  7. Jeff KingMay 19, 2021
  8. Derrick StoleeMay 19, 2021
  9. Junio C HamanoMay 19, 2021
  10. brian m. carlsonMay 19, 2021
  11. Jeff KingMay 19, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.