Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f3caa3

Browse files
committed
Further clarify comment in test_hook_uses_shell_not_from_cwd
1 parent3eb7c2a commit1f3caa3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎test/test_index.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,16 +1032,16 @@ def test_hook_uses_shell_not_from_cwd(self, rw_dir, case):
10321032
maybe_chdir=cwd(rw_dir)ifchdir_to_repoelsecontextlib.nullcontext()
10331033
repo=Repo.init(rw_dir)
10341034

1035-
# We need an impostor shell that works on Windows and thatcan be distinguished
1036-
# from the real bash.exe. But even if the real bash.exe is absent or unusable,
1037-
# we should verifythatthe impostor is not run. So the impostor needs a clear
1038-
# side effect (unlike in TestGit.test_it_executes_git_not_from_cwd). Popen on
1039-
# Windows uses CreateProcessW, which disregards PATHEXT; the impostor may need
1040-
# to be a binary executable to ensure the vulnerability is found if present. No
1041-
# compiler need exist, shipping a binary in the test suite may target the wrong
1042-
# architecture, and generating one in a bespoke way maycause virus scanners to
1043-
#give afalse positive. So we use a Bash/Python polyglot for the hook and use
1044-
# the Python interpreter itself as the bash.exe impostor. But an interpreter
1035+
# We need an impostor shell that works on Windows and thatthe test can
1036+
#distinguishfrom the real bash.exe. But even if the real bash.exe is absent or
1037+
#unusable,we should verify the impostor is not run. So the impostor needs a
1038+
#clearside effect (unlike in TestGit.test_it_executes_git_not_from_cwd). Popen
1039+
#onWindows uses CreateProcessW, which disregards PATHEXT; the impostor may
1040+
#needto be a binary executable to ensure the vulnerability is found if
1041+
#present. Nocompiler need exist, shipping a binary in the test suite may
1042+
#target the wrongarchitecture, and generating one in a bespoke way maytrigger
1043+
# false positive virus scans. So we use a Bash/Python polyglot for the hook and
1044+
#usethe Python interpreter itself as the bash.exe impostor. But an interpreter
10451045
# from a venv may not run when copied outside of it, and a global interpreter
10461046
# won't run when copied to a different location if it was installed from the
10471047
# Microsoft Store. So we make a new venv in rw_dir and use its interpreter.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp