TestRunCommandHelper_RejectsPathEscapingRoot/absolute_path fails on Windows
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 67/100
Research direction
Read internal/tools/tools_test.go at TestRunCommandHelper_RejectsPathEscapingRoot and trace how run_command validates its path argument with Go's filepath.IsAbs. Decide how Windows rooted paths should be handled, then run that test on Windows and another platform. Done when the test has consistent, intentional expectations across platforms and passes.
Written by the indexing model from the issue text.
Description
TestRunCommandHelper_RejectsPathEscapingRoot/absolute_path fails on Windows.
What happens
The test passes "/etc" as the path argument to run_command and expects an error result before any confirm prompt. On Windows, /etc is not an absolute path to filepath.IsAbs, so the path is not rejected there. The command reaches the interactive y/n confirm instead, and the test gets a different result.
The other three cases in the same test (../outside, a/../../etc, sub/../../secrets) pass on Windows.
Where this showed up
- Seen on Windows in #21 and #23 (each PR's test run). Both PR authors noted that the same failure happens on the base branch (
1bff3dfin #23). - The test is in
internal/tools/tools_test.goatTestRunCommandHelper_RejectsPathEscapingRoot.
Suggested direction
Decide what "absolute" means for path arguments on Windows. Either treat a leading / or \ as rooted when checking path (so /etc is rejected on every platform), or change the test to use a Windows-absolute path such as C:\Windows on Windows only. The first keeps one expectation across platforms.
I have not run this on the current main (335144d); the report above is from the PR runs.
- Dominant language
- Go
- Stars
- 1
- Forks
- 2
- Avg merge
- 18h 26m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Edwin-metcalf/MetCode
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
Edwin-metcalf/MetCode#26 ·
Maintainers usually reply within 1 day
-
documentation enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Edwin-metcalf/MetCode#19 ·
Maintainers usually reply within 1 day
-
testing
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Edwin-metcalf/MetCode#9 ·
Maintainers usually reply within 1 day
-
Add a MakefileOpenenhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Edwin-metcalf/MetCode#8 ·
Maintainers usually reply within 1 day
-
Add a --host flagOpenenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Edwin-metcalf/MetCode#7 ·
Maintainers usually reply within 1 day
All issues in Edwin-metcalf/MetCode
Similar issues
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kubevirt/kubevirt#19559 · 1 reaction ·
Maintainers usually reply within 1 day
-
bug raised-by:verifier
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
medici-finance/assay#3817 ·
Maintainers usually reply within 1 day
-
automation models
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
gtsteffaniak/filebrowser#3244 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
QuantumNous/new-api#7930 ·
Maintainers usually reply within 1 day