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

Change default permission for files to 644 #170

Closed

Conversation

tamano
Copy link

@tamano tamano commented Oct 15, 2015

Solves #113 .

I didn't do anything for directories because it already had permission 755.

@ryotarai
Copy link
Member

Thank you.

My concern are:

  • Is Chef's behavior the same as this PR or not?
  • umask value will be ignored

What do you think about these point?

@tamano
Copy link
Author

tamano commented Oct 22, 2015

Thank you for reviewing.

Is Chef's behavior the same as this PR or not?

Yes it does. I've tested. Below gist is the log.

https://gist.github.com/tamano/3b5e844ae3bbb0e09e93

umask value will be ignored

I think this depends on policy. IMO it's ok because of compatibility with Chef (Chef also ignores umask; See gist above).

@ryotarai
Copy link
Member

ryotarai commented Dec 2, 2015

Sorry for very late reply.
This PR changes only permission of a file, doesn't it?
Permission of a directory should be changed too

@tamano
Copy link
Author

tamano commented Dec 14, 2015

Thank you for coming back.

This PR changes only permission of a file, doesn't it?

Yes. As I mentioned before, directories already had default permission 755.
Could you confirm the gist below?

https://gist.github.com/tamano/3b5e844ae3bbb0e09e93

Please let me know if my testing way is poor or wrong.
Thanks.

@ryotarai
Copy link
Member

Sorry for late reply.

Yes. As I mentioned before, directories already had default permission 755.

I think umask also affects permission of a directory like the below and it should be 755 regardless of umask.

$ cat tmp/umask.rb
file "sample-file"
directory "sample-dir"
$ umask
022
$ b bin/itamae local tmp/umask.rb
 INFO : Starting Itamae...
 INFO : Recipe: /Users/ryota-arai/src/github.com/itamae-kitchen/itamae/tmp/umask.rb
 INFO :   file[sample-file] exist will change from 'false' to 'true'
 INFO :   directory[sample-dir] exist will change from 'false' to 'true'
$ ls -la sample-*
-rw-r--r--  1 ryota-arai  staff  0  3 15 10:00 sample-file

sample-dir:
total 0
drwxr-xr-x   2 ryota-arai  staff   68  3 15 10:00 .
drwxr-xr-x  22 ryota-arai  staff  748  3 15 10:00 ..
$ umask 266
$ umask
0266
$ rm sample-*
rm: sample-dir: is a directory
$ rmdir sample-dir
$ b bin/itamae local tmp/umask.rb
 INFO : Starting Itamae...
 INFO : Recipe: /Users/ryota-arai/src/github.com/itamae-kitchen/itamae/tmp/umask.rb
 INFO :   file[sample-file] exist will change from 'false' to 'true'
 INFO :   directory[sample-dir] exist will change from 'false' to 'true'
$ ls -la sample-*
-r--------  1 ryota-arai  staff  0  3 15 10:01 sample-file

sample-dir:
total 0
dr-x--x--x   2 ryota-arai  staff   68  3 15 10:01 .
drwxr-xr-x  22 ryota-arai  staff  748  3 15 10:01 ..

@ryotarai
Copy link
Member

ryotarai commented Jul 7, 2016

I think umask also affects permission of a directory like the below and it should be 755 regardless of umask.

How about this? I'm going to close this issue for now but feed free to reopen.

@ryotarai ryotarai closed this Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants