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

Re: [PATCH] gitk - override $PATH search only on Windows

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Mar 31, 2025, 19:29 UTC
Message-ID
<5b09f1c2-be58-43a2-9908-7243b5207251@gmail.com>
In-Reply-To
<58556f57-698d-4f58-bbcf-c752cba00ff7@kdbg.org>
On 3/31/25 1:12 PM, Johannes Sixt wrote:
Show 19 quoted lines
> Am 31.03.25 um 17:12 schrieb Mark Levedahl:
>> Commit 4cbe9e0e2 was written to address problems that result from Tcl's
>> documented behavior on Windows where the current working directory and a
>> number of Windows system directories are automatically prepended to
>> $PATH when searching for executables [1].  This basic Windows behavior
>> has resulted in more than one CVE against git for Windows:
>> CVE-2023-23618, CVE-2022-41953 are listed on the git for Windows github
>> website for the Tcl components of git (gitk, git-gui).
>>
>> 4cbe9e0e2 is intended to restrict the search to looking only in
>> directories given in $PATH and in the given order, which is exactly the
>> Tcl behavior documented to exist on non-Windows platforms [1]. Thus,
>> this change could have been written to affect only Windows, leaving
>> other platforms alone.
>>
>> However, 4cbe9e0e2 implements the override for all platforms.  and
>> includes specialized code for Cygwin, copied copied from git-gui prior
>> to commit 6d2f9d90 on https://github.com/j6t/git-gui.git), so targets a
> I can't find 6d2f9d90 anywhere. Do you have a URL?
Sorry about that (bad copy / paste). Should be 7145c654
https://github.com/j6t/git-gui/commit/7145c654fffecd1f3d4a2b8bf05755ce262903e8
> Now that this code is only about Windows, _search_exe is always ".exe".
> It would be great if we could remove it as well.
>
Will do for v2.
Mark
Previous: Johannes SixtNext: Mark Levedahl
Message 6 of 13 in “git v2.49.0 - gitk regression on Cygwin”
  1. Mark LevedahlMar 28, 2025
  2. Johannes SixtMar 28, 2025
  3. Mark LevedahlMar 29, 2025
  4. gitk - override $PATH search only on WindowsMark Levedahl, Mar 31, 2025
  5. Johannes SixtMar 31, 2025
  6. Mark LevedahlMar 31, 2025
  7. 0/3 gitk: override PATH search only on WindowsMark Levedahl, Apr 1, 2025
  8. 1/3 gitk: override $PATH search only on WindowsMark Levedahl, Apr 1, 2025
  9. 2/3 gitk: _search_exe is no longer neededMark Levedahl, Apr 1, 2025
  10. 3/3 gitk: limit PATH search to bare executable namesMark Levedahl, Apr 1, 2025
  11. Johannes SchindelinApr 1, 2025
  12. Mark LevedahlApr 1, 2025
  13. Johannes SixtApr 1, 2025

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.