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(cosmovisor): fixed cosmovisor add-upgrade permissions #20062

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/cosmovisor/cmd/cosmovisor/add_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

// create upgrade dir
upgradeLocation := cfg.UpgradeDir(upgradeName)
if err := os.MkdirAll(path.Join(upgradeLocation, "bin"), 0o750); err != nil {
if err := os.MkdirAll(path.Join(upgradeLocation, "bin"), 0o755); err != nil {
Dismissed Show dismissed Hide dismissed
return fmt.Errorf("failed to create upgrade directory: %w", err)
}

Expand Down Expand Up @@ -110,7 +110,7 @@
return fmt.Errorf("failed to check if file exists: %w", err)
}

if err := os.WriteFile(path, data, 0o600); err != nil {
if err := os.WriteFile(path, data, 0o755); err != nil {
Dismissed Show dismissed Hide dismissed
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a changelog in cosmovisor and a nolint comment so we don't revert it back because of the gosec? And so that linting passes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cmd/cosmovisor/add_upgrade.go:58:2: directive `//nolint:gosec` is unused for linter "gosec" (nolintlint)
	//nolint:gosec
	^
cmd/cosmovisor/add_upgrade.go:115:2: directive `//nolint:gosec` should provide explanation such as `//nolint:gosec // this is why` (nolintlint)
	//nolint:gosec
	^

lol now it gives me this. do you think it's worth disabling? or what's better to do here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nevermind, I fixed it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and also added the changelog entry. @julienrbrt can you check?

return fmt.Errorf("failed to write binary to location: %w", err)
}

Expand Down