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

update newBinaryCmd URL path handling #2041

Merged
merged 1 commit into from Feb 28, 2024
Merged

update newBinaryCmd URL path handling #2041

merged 1 commit into from Feb 28, 2024

Conversation

anmaxvl
Copy link
Contributor

@anmaxvl anmaxvl commented Feb 28, 2024

Windows UNC paths weren't properly handled by filepath.Clean and this behavior was fixed in
golang/go@be9d78c

For a binary URL binary:///\executable, the URL.Path will be /\executable and filepath.Clean
will now return \\executable, which previously would return \executable.

In the case of binary logger, it'd be safer to not accept UNC paths, so this PR adds a
short circuit when the clean path starts with \\.

@anmaxvl anmaxvl requested a review from a team as a code owner February 28, 2024 00:21
Windows UNC paths weren't properly handled by `filepath.Clean` and
this behavior was fixed in golang/go@be9d78c

For a binary URL `binary:///\executable`, the `URL.Path` will be
`/\executable` and `filepath.Clean` will now return `\\executable`,
which previously would return `\executable`.
In the case of binary logger, it'd be safer to not accept UNC paths,
so this PR adds a short circuit when the clean path starts with `\\`.

Signed-off-by: Maksim An <maksiman@microsoft.com>
@anmaxvl anmaxvl merged commit a50f1b0 into upgradeGo Feb 28, 2024
32 checks passed
@anmaxvl anmaxvl deleted the update-binary-cmd branch February 28, 2024 02:50
anmaxvl added a commit that referenced this pull request Mar 1, 2024
Signed-off-by: Maksim An <maksiman@microsoft.com>
kiashok pushed a commit to kiashok/hcsshim that referenced this pull request Mar 1, 2024
Signed-off-by: Maksim An <maksiman@microsoft.com>
kiashok pushed a commit that referenced this pull request Mar 4, 2024
Signed-off-by: Maksim An <maksiman@microsoft.com>
kiashok pushed a commit that referenced this pull request Mar 5, 2024
Signed-off-by: Maksim An <maksiman@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants