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(snapshot): grant execution permissions to the snapshot dir for the owner #18294

Merged
merged 3 commits into from
Oct 29, 2023

Conversation

luchenqun
Copy link
Contributor

@luchenqun luchenqun commented Oct 29, 2023

Description

In PR #18206 , the permissions of snapshot dir were modified. However, in my macos sonoma 14, when executing simd start --home ./nodes/node0/simd the following error occurred: panic: failed to initialize database: stat nodes/node0/simd /data/snapshots/metadata.db: permission denied. The main reason is lack of execute permissions for the owner.

In addition, search for the keyword os.MkdirAll in the project, and the owner will have executable permissions.

Summary by CodeRabbit

  • New Feature: Enhanced the snapshot feature by improving access permissions. This update allows the owner to execute commands in the snapshot directory, providing more control and flexibility. This change is aimed at improving the user experience and functionality of the snapshot feature.

@luchenqun luchenqun requested a review from a team as a code owner October 29, 2023 05:30
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2023

Walkthrough

The recent changes primarily focus on enhancing the security and accessibility of the snapshot feature. The permissions for the snapshot directory have been modified to allow execution by the owner, thereby ensuring better control and functionality.

Changes

File Path Summary
CHANGELOG.md The diff includes a change related to the snapshot feature, granting execution permissions to the snapshot directory for the owner.
server/.../util.go The diff modifies file permissions when creating a directory. The code now uses permissions 0o744 (readable and executable by owner, readable by group and others), replacing the previous 0o644.

🐰💻

In the land of code, where the rabbits play,

Changes were made, to brighten the day.

Permissions tweaked, for the owner's delight,

Now the snapshot feature, shines bright in the night.

So hop along, with joy and cheer,

For in the world of code, there's nothing to fear! 🎉🥕


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 32151e5 and 7db434b.
Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • server/util.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • CHANGELOG.md
  • server/util.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7db434b and 58581fc.
Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

server/util.go Dismissed Show dismissed Hide dismissed
CHANGELOG.md Outdated
@@ -76,6 +76,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/gov) [#17873](https://github.com/cosmos/cosmos-sdk/pull/17873) Fail any inactive and active proposals whose messages cannot be decoded.
* (simulation) [#17911](https://github.com/cosmos/cosmos-sdk/pull/17911) Fix all problems with executing command `make test-sim-custom-genesis-fast` for simulation test.
* (simulation) [#18196](https://github.com/cosmos/cosmos-sdk/pull/18196) Fix the problem of `validator set is empty after InitGenesis` in simulation test.
* (snapshot) [#18294](https://github.com/cosmos/cosmos-sdk/pull/18294) Grant execution permissions to the snapshot dir for the owner.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* (snapshot) [#18294](https://github.com/cosmos/cosmos-sdk/pull/18294) Grant execution permissions to the snapshot dir for the owner.

No changelog needed as this regression never been released (#18206)

@julienrbrt julienrbrt added backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release labels Oct 29, 2023
@julienrbrt julienrbrt added this pull request to the merge queue Oct 29, 2023
Merged via the queue into cosmos:main with commit a378303 Oct 29, 2023
52 of 55 checks passed
mergify bot pushed a commit that referenced this pull request Oct 29, 2023
…e owner (#18294)

Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit a378303)
mergify bot pushed a commit that referenced this pull request Oct 29, 2023
…e owner (#18294)

Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit a378303)
julienrbrt pushed a commit that referenced this pull request Oct 29, 2023
julienrbrt pushed a commit that referenced this pull request Oct 29, 2023
atheeshp pushed a commit that referenced this pull request Nov 1, 2023
…e owner (#18294)

Co-authored-by: Julien Robert <julien@rbrt.fr>
@faddat faddat mentioned this pull request Mar 20, 2024
12 tasks
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants