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

Re: [BUG] credential wildcard does not match hostnames containing an underscore

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 12, 2021, 18:28 UTC
Message-ID
<xmqqfst63xno.fsf@gitster.g>
In-Reply-To
<2883c3a9-a44f-4b24-acac-5ed573319d27@www.fastmail.com>
"Alex Waite" <alex@waite.eu> writes:
Show 12 quoted lines
> Thanks for the response. :-)
>
>> Hmph, given that hostnames cannot have '_' (cf. RFC1123 2.1 "Host
>> Names and Numbers", for example), the third URL seems invalid.  Is
>> this even a bug?
>
> That is a fair question, and I do acknowledge that later on in my bug report (where I provide some additional information).
>
> The core issue, IMO, is that git is not consistent with itself. I
> can write a static rule that will match
> ("https://test_c.example.com") but cannot write a pattern that
> will do so.
I do not know if that is avoidable.

To be able to match a concrete URL that came from the running session with a pattern taken from the configuration, we'd need to do some parsing to figure out which part of the URL matches the wildcard, and to be able to tell which substrings are "parts", there needs some syntactic rule that says what constitutes a valid word.

I guess that we could make them consistent by treating a literal as a pattern that does not happen to have any wildcard and reject the "test_c" hostname the same way in both cases. I do not offhand know how desirable such a change would be.

Previous: Alex WaiteNext: Jeff King
Message 4 of 17 in “[BUG] credential wildcard does not match hostnames containing an underscore”
  1. Alex WaiteOct 12, 2021
  2. Junio C HamanoOct 12, 2021
  3. Alex WaiteOct 12, 2021
  4. Junio C HamanoOct 12, 2021
  5. Jeff KingOct 12, 2021
  6. Jeff KingOct 12, 2021
  7. Jeff KingOct 12, 2021
  8. urlmatch: add underscore to URL_HOST_CHARSJeff King, Oct 12, 2021
  9. brian m. carlsonOct 12, 2021
  10. Jeff KingOct 12, 2021
  11. brian m. carlsonOct 12, 2021
  12. Jeff KingOct 12, 2021
  13. brian m. carlsonOct 12, 2021
  14. Aaron SchrabOct 12, 2021
  15. Alex WaiteOct 13, 2021
  16. Philip OakleyOct 14, 2021
  17. brian m. carlsonOct 12, 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.