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

Use 764 for files created #5434

Closed
bep opened this Issue Nov 13, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@bep
Member

bep commented Nov 13, 2018

In working with #5404 I notice that we create new files (in library helpers here and in Afero) with "0777 // before umask". I understand the need for the execute bit on directories, and while umask is great, it may be a little technical to most people, and we should consider making this something more strict for regular files.

https://chmodcommand.com/chmod-764/

Opinions @moorereason @kaushalmodi @anthonyfok ?

@bep bep added the Enhancement label Nov 13, 2018

@bep bep added this to the v0.52 milestone Nov 13, 2018

@moorereason

This comment has been minimized.

Contributor

moorereason commented Nov 13, 2018

I think we should defer this to umask. Don't fight against the host system; work within it. I suspect that we'll have bug reports that Hugo isn't respecting umask if we make this change.

@bep

This comment has been minimized.

Member

bep commented Nov 14, 2018

@moorereason never mind, I have re-read the code: We create directories with 0777 before umask (we need the execute bit here), but file creation is delegated to os.Create, which uses mode 0666 (before umask).

@bep bep closed this Nov 14, 2018

bep added a commit to bep/hugo that referenced this issue Nov 14, 2018

bep added a commit to bep/hugo that referenced this issue Nov 14, 2018

bep added a commit to bep/hugo that referenced this issue Nov 14, 2018

bep added a commit to bep/hugo that referenced this issue Nov 14, 2018

bep added a commit to bep/hugo that referenced this issue Nov 14, 2018

bep added a commit to bep/hugo that referenced this issue Nov 14, 2018

bep added a commit to bep/hugo that referenced this issue Nov 14, 2018

bep added a commit that referenced this issue Nov 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment