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
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 12, 2021, 21:48 UTC
Message-ID
<YWYCh3+37d27QNjW@camp.crustytoothpaste.net>
In-Reply-To
<YWX+6OgzN4CDzomO@coredump.intra.peff.net>
On 2021-10-12 at 21:32:24, Jeff King wrote:
Show 7 quoted lines
> On Tue, Oct 12, 2021 at 09:21:59PM +0000, brian m. carlson wrote:
> > I'm happy to put in a change to reject these hostnames altogether, but I
> > won't get to it before Friday.
> 
> IMHO _that_ is the thing that will produce breakage. People who are not
> using URL-specific config but are happily using foo_bar.example.com will
> now get a failure for something that used to work.

There's a well-known bug on Tumblr, where it allocated hostnames for users that happened to start or end with a dash, which is not allowed. This worked great on Windows systems, which don't care, but every Unix system was broken.

When we decide to allow this particular case, we end up with the problem that people won't see consistent behavior across systems and tools. It may be that libgit2 rejects this, or Git LFS, or some other tool in the ecosystem, and then we'll have people complaining that "Well, Git accepts it, so why don't you?" which I am not eager to see. I, for example, have absolutely zero control over the URL parsing library that's used in Git LFS, and the Go team has demonstrated that they don't care one bit about supporting Git-related tooling. That doesn't even include a variety of proprietary Unix systems that might have different rules or resolvers.

I am also not eager to see additional bug reports for this case that will need to be fixed under the precedent that we accepted a patch to fix it before. If there's a concern that rejecting these hostnames altogether would break existing users, then we can just do nothing, and tell users that their syntax is not valid and they need to fix their hostnames. This rule has been documented since before ISO standardized C, so it shouldn't be new to anyone deploying systems or DNS.

So I'm fine with doing nothing, or rejecting these hostnames, but not allowing more lenient syntax, because it will probably be broken somewhere and we (or someone else in the ecosystem) will have to deal with it again down the line.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Jeff KingNext: Jeff King
Message 11 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.