Avoid running git upload pack through shell#2060
Draft
dscho wants to merge 3 commits intogitgitgadget:masterfrom
Draft
Avoid running git upload pack through shell#2060dscho wants to merge 3 commits intogitgitgadget:masterfrom
dscho wants to merge 3 commits intogitgitgadget:masterfrom
Conversation
On Windows, file:// URLs need to have Windows paths. In Git's test suite, however, by virtue of being implemented in shell and using the Unix paths that are so conveniently converted to Windows behind the scenes by the POSIX emulation layer required to run the shell, quite often file:// URLs are used that use _Unix_ paths. Now, `git upload-pack` is a Windows program in Git for Windows, and has not the first idea what do do about Unix paths. The only reason why those incorrect file:// URLs still "work" in the test suite is that Git insists on calling `git upload-pack` through a shell, even if the complexity of the command-line `git-upload-pack <path>` does not warrant the penalty. And that shell, again by virtue of using that POSIX emulation layer, automagically converts that incorrect Unix path to a Windows one. However, it is incorrect to use file:// URLs with incorrect paths. Therefore, let's just fix those URLs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There is logic hidden deep inside `run-command.c` that determines whether a given command _actually_ needs to be run through shell (for example, if `git-upload-pack` is the program name, it does not need the shell at all). Extract this useful functionality into its own function. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When the `git-upload-pack` program needs to be called, we do not actually need to run this through a shell... This reduces the security surface of running Git on servers a bit. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: I still have to consider whether the many changes required in the test suite are indicative of a serious backwards-compatibility problem.