Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with Windows pathes not being escaped when applying a regexp. #1395

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

rhuss
Copy link
Contributor

@rhuss rhuss commented Jul 21, 2021

Description

There have been issues when a full Windows path has been inserted literally to create a regexp, since the backslashes used as path separators are confusing the regexp engine. This fix will quote any input coming from the outside.

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 21, 2021
@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 21, 2021
@codecov
Copy link

codecov bot commented Jul 21, 2021

Codecov Report

Merging #1395 (e363da6) into main (bef27e9) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1395   +/-   ##
=======================================
  Coverage   78.12%   78.12%           
=======================================
  Files         160      160           
  Lines        8234     8234           
=======================================
  Hits         6433     6433           
  Misses       1107     1107           
  Partials      694      694           
Impacted Files Coverage Δ
cmd/kn/main.go 87.32% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bef27e9...e363da6. Read the comment docs.

@@ -335,6 +335,15 @@ func TestRunWithExit(t *testing.T) {
}
}

func TestExtractCommandPathFromErrorMessage(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dsimansk
Copy link
Contributor

Thanks! Looks good to me.

@rhuss fancy adding changelog entry for the fix?

Copy link
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No easy why to really test this myself. Assuming you did.
/ok-to-test
/approve
/lgtm

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. lgtm Indicates that a PR is ready to be merged. labels Jul 21, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maximilien, rhuss

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 5a44969 into knative:main Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants