You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Allowing `usr` as a `<platform>` prefix is more likely to produce
desired than undesired behavior. But due to the ambiguity of the
name `usr` on non-Unix systems, maybe this would lead to problems
that are relevant to security. The concern is described and the
`usr` prefix, which is never needed to find the shell in a Git
for Windows installation, is no longer matched.
Note that this only affects it as a path component that
`libexec/git-core` is found initially to be in. We do still use
<prefix>/libexec/git-core/../../../usr/bin/sh.exe
if we don't find something we can plausibly use at:
`<prefix>/libexec/git-core/../../../bin/sh.exe
The helper docstring explains why a security model under which
this is reasonable does necessarily entail that it is reasonable
to allow a `<prefix>` of `usr`, *even though* in the path with
`usr` that we form, it is `usr` in the `<prefix>` position.
With that said, and even though it does not help find `sh` from
Git for Windows, hopefully future research can establish that it
is safe to treat `usr/libexec/git-core` the same as platform
prefixes like `mingw64/libexec/git-core` and it can be enabled.
- Start refactoring by extracting and renaming the recently
introduced helper constants and functions.
- Extract most of the `cfg!(windows)` branch in `shell()` itself,
even with its helpers already extracted, to make it a helper
function as well.
- Document the recently introduced helper constants.
0 commit comments