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

plugins: install SHA256SUM file with 0644 perms #12665

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

lbajolet-hashicorp
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp commented Oct 25, 2023

When invoking packer plugins install to install a plugin, or packer init, the checksum file would be installed with 0555 permissions.

This led in turn to further attempts at installing the plugin will succeed, but the checksum file would not be updated, as it was marked non-writable by the owner of the file, leading potentially to a situation where the plugin binary and the checksum would be out-of-sync, but could not be updated unless the user changed it.

To avoid such a problem, we write the checksum file with 0644 permissions, so the owner can read/write, while the other users can only read it.

When invoking `packer plugins install' to install a plugin, or `packer
init', the checksum file would be installed with 0555 permissions.

This led in turn to further attempts at installing the plugin will
succeed, but the checksum file would not be updated, as it was marked
non-writable by the owner of the file, leading potentially to a
situation where the plugin binary and the checksum would be out-of-sync,
but could not be updated unless the user changed it.

To avoid such a problem, we write the checksum file with 0644
permissions, so the owner can read/write, while the other users can only
read it.
@lbajolet-hashicorp lbajolet-hashicorp marked this pull request as ready for review October 25, 2023 21:01
@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner October 25, 2023 21:01
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

Yes!!! 👍

@lbajolet-hashicorp lbajolet-hashicorp merged commit 3c8de6e into main Oct 26, 2023
10 checks passed
@lbajolet-hashicorp lbajolet-hashicorp deleted the checksum_0644 branch October 26, 2023 14:35
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants