From: Mark Levedahl Date: Wed, 2 Apr 2025 21:37:27 +0000 (-0400) Subject: git-gui: avoid auto_execok for git-bash menu item X-Git-Tag: v2.43.7~4^2~1^2~5 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=411cd493cb9998c2ba1c17dd98c3d3d4b121a1dd;p=thirdparty%2Fgit.git git-gui: avoid auto_execok for git-bash menu item On Windows, git-gui offers to open a git-bash session for the current repository from the menu, but uses [auto_execok start] to get the command to actually run that shell. The code for auto_execok, in /usr/share/tcl8.6/tcl.init, has 'start' in the 'shellBuiltins' list for cmd.exe on Windows: as a result, auto_execok does not actually search for start, meaning this usage is technically ok with auto_execok now. However, leaving this use of auto_execok in place will just induce confusion about why a known unsafe function is being used on Windows. Instead, let's switch to using our known safe _which function that looks only in $PATH, excluding the current working directory. Signed-off-by: Mark Levedahl Signed-off-by: Johannes Sixt Signed-off-by: Taylor Blau --- diff --git a/git-gui.sh b/git-gui.sh index 72da2443e5..3bfe4364c7 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2769,7 +2769,7 @@ if {[is_Windows]} { } .mbar.repository add command \ -label [mc "Git Bash"] \ - -command {eval exec [auto_execok start] $cmdLine} + -command {eval exec [list [_which cmd] /c start] $cmdLine} } if {[is_Windows] || ![is_bare]} {