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 a bug where malformed paths don't get written to the destination dir #61298
Conversation
@brendandburns: Adding do-not-merge/release-note-label-needed because the release note process has not been followed. One of the following labels is required "release-note", "release-note-action-required", or "release-note-none". Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test pull-kubernetes-e2e-gce |
/release-note-none |
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, jessfraz, liggitt 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 |
I would have assumed that a |
/retest Review the full test history for this PR. Silence the bot with an |
@cjcullen I'm not sure what is canonical or not, this seems to me to be fine, but I can also return an error if that is the preferred approach. |
// clean prevents path traversals by stripping them out. | ||
// This is adapted from https://golang.org/src/net/http/fs.go#L74 | ||
func clean(fileName string) string { | ||
return path.Clean(string(os.PathSeparator) + fileName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brendanburns will prefixing os.PathSeparator
work for you on windows? (is fileName likely to be c:/abc
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(is fileName likely to be c:/abc)?
Not with any legitimate response from the container (since we're invoking the tar command and not building tar files with absolute paths).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack @liggitt thanks!
LGTM 👍 |
[MILESTONENOTIFIER] Milestone Pull Request Labels Incomplete @brendandburns @jessfraz @liggitt Action required: This pull request requires label changes. If the required changes are not made within 2 days, the pull request will be moved out of the v1.10 milestone. kind: Must specify exactly one of |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
Fixes #61297
@liggitt @hansmi @cjcullen @jessfraz