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

Minor changes #241

Merged
merged 2 commits into from
Dec 20, 2024
Merged

Minor changes #241

merged 2 commits into from
Dec 20, 2024

Conversation

pierreprinetti
Copy link
Contributor

This PR proposes two changes.

First commit:

Remove deprecated ioutil

Second commit:

Replace go-homedir with stdlib calls

The purpose of github.com/mitchellh/go-homedir was to expand the user
home directory without CGO. Recent versions of `os/user` can retrieve
the user home directory without CGO and thus enable cross-compilation.

This change does not add the missing functionality of expanding
non-current-user home directories in a path (e.g. `~user2/dir/subdir`).
The reason for this is that the input of `pathOrContents` could be a
blob and parsing every byte slice matching `^~.*\/.*` as a path
considerably increases the chances that a binary blob is mistakenly
parsed as a path.

@pierreprinetti pierreprinetti requested a review from a team December 20, 2024 10:27
mandre
mandre previously approved these changes Dec 20, 2024
The purpose of github.com/mitchellh/go-homedir was to expand the user
home directory without CGO. Recent versions of `os/user` can retrieve
the user home directory without CGO and thus enable cross-compilation.

This change does not add the missing functionality of expanding
non-current-user home directories in a path (e.g. `~user2/dir/subdir`).
The reason for this is that the input of `pathOrContents` could be a
blob and parsing every byte slice matching `^~.*\/.*` as a path
considerably increases the chances that a binary blob is mistakenly
parsed as a path.
@mandre mandre merged commit 2e0af06 into gophercloud:master Dec 20, 2024
1 check passed
@mandre mandre deleted the minor branch December 20, 2024 10:44
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.

2 participants