-
Notifications
You must be signed in to change notification settings - Fork 187
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
Change all file permissions to octal format #653
Change all file permissions to octal format #653
Conversation
021e744
to
e0f7d59
Compare
Hi @peterfication, thanks for working on this. It looks good to me. Could you rebase it against the latest main branch? |
@pjbgf can you go over this and see if there is room to lower some of the file and/or directory permissions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a rule of thumb, the PermMode should be 0o660
(or less) for files and 0o770
(or less) for directories. Based on the common umask value of 0o022
, files are created as 0o640
(or less) and directories 0o750
(or less).
Currently we rely on the machine set umask value, which may yield different results depending on OS/Distro. In the future we could pursue setting a controller level umask
value to enforce 0o027
across test/runtime (i.e. syscall.Umask(0o027)
).
1a29c07
to
858dd53
Compare
@peterfication |
This better represent permissions as Linux handles such information in octal format, meaning that the left-most 0 has an important meaning and is not to be ignored as normally integers would. See fluxcd#603 Signed-off-by: Peter Gundel <[email protected]>
1c5b435
to
625fb88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peterfication I noticed that there are 5 occurrences in total in storage_test.go
that could be changed from 0o755
to 0o750
. Would you mind changing those too please?
I pointed out 3 on the review.
625fb88
to
90d2291
Compare
I just realized that there is one place left in Also, there are a lot of places with permission |
@peterfication yes, please, that would be awesome! |
As suggested by @pjbgf Co-authored-by: Paulo Gomes <[email protected]> Co-authored-by: Paulo Gomes <[email protected]> Signed-off-by: Peter Gundel <[email protected]>
90d2291
to
37551f1
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peterfication great stuff, thank you for working on this. 🙇 🙇 🙇
LGTM
This better represent permissions as Linux handles such information in
octal format, meaning that the left-most 0 has an important meaning
and is not to be ignored as normally integers would.
See #603