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

Avoid creating executable files #865

Closed
wants to merge 4 commits into from
Closed

Avoid creating executable files #865

wants to merge 4 commits into from

Conversation

ramikg
Copy link
Contributor

@ramikg ramikg commented Jul 28, 2023

Description

This PR removes all executable bits in calls to os.OpenFile() or os.WriteFile().

Previously, the file mode passed to these functions was os.ModePerm (which is equal to 0777, i.e. read/write/execute for everyone), which may have undesirable consequences.
This value is sometimes used by Go programmers because it is conveniently exported in the os package, but it's intended usage is as a bitmask, and not as a file mode.
I've changed this value to 0666 (i.e. removed the executable bits), like the one used by Go's os.Create().

Checklist

  • Code compiles correctly
  • Run make fmt to fix inconsistent formats
  • Run make lint to get lint errors and fix all of them
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

@github-actions
Copy link

github-actions bot commented Jul 28, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@ramikg
Copy link
Contributor Author

ramikg commented Jul 28, 2023

I have read the CLA Document and I hereby sign the CLA

@ramikg ramikg marked this pull request as ready for review July 28, 2023 09:41
@ramikg ramikg requested a review from a team as a code owner July 28, 2023 09:41
@ramikg ramikg marked this pull request as draft July 28, 2023 10:15
@ramikg ramikg marked this pull request as ready for review July 28, 2023 10:15
Copy link
Collaborator

@sfc-gh-pfus sfc-gh-pfus left a comment

Choose a reason for hiding this comment

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

Hello @ramikg ! We are really thankful for your initiative! If you would like to implement boy scout rule and address some of my comments it would be really great. Thanks!

azure_storage_client.go Outdated Show resolved Hide resolved
azure_storage_client.go Outdated Show resolved Hide resolved
doc.go Outdated Show resolved Hide resolved
encrypt_util.go Outdated Show resolved Hide resolved
encrypt_util_test.go Outdated Show resolved Hide resolved
gcs_storage_client.go Outdated Show resolved Hide resolved
local_storage_client_test.go Outdated Show resolved Hide resolved
put_get_test.go Outdated Show resolved Hide resolved
put_get_test.go Outdated Show resolved Hide resolved
put_get_user_stage_test.go Outdated Show resolved Hide resolved
@ramikg
Copy link
Contributor Author

ramikg commented Aug 1, 2023

Hello @ramikg ! We are really thankful for your initiative! If you would like to implement boy scout rule and address some of my comments it would be really great. Thanks!

Thank you. I've addressed all comments except for one, which I've commented on.

@sfc-gh-pfus
Copy link
Collaborator

Thanks a lot! I answered your concern, I hope that I can convince you.

@sfc-gh-pfus
Copy link
Collaborator

@ramikg thank you very much for you input! Your help is appreciated :) Unfortunately, our policy does not allow direct merges from community, but I marked you as co-authored-by in the git commit.

@sfc-gh-pfus sfc-gh-pfus closed this Aug 2, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants