-
Notifications
You must be signed in to change notification settings - Fork 315
Set correct file permissions given a umask of 0027 #294
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
Comments
Note, I believe bug exists because the permission calculation introduced in Pull #237 relies on direct subtraction (0666 - 0027 = 0637) and in reality linux must not actually use direct subtraction internally. |
hainesr
added a commit
to hainesr/rubyzip
that referenced
this issue
Sep 1, 2016
This fixes rubyzip#294 in what I hope is a more sensible way than trying to mess with umasks, etc, directly. Temporary files were being created with 0600 permissions and then being set to different permissions, based on umask, etc, afterwards. I don't know what the rationale for this was, but there were errors in the umask calculations when moving from the temporary file to the intended end result.
I've had a go at fixing this in #300. Can people comment on whether how I've fixed it is sensible? |
simonoff
added a commit
that referenced
this issue
Nov 9, 2016
Fix permissions on new zip files (#294)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We lock down our umask to 0027 so that files are not globally readable. When creating files via
File.open
this results in files with permissions of 0640 (i.e.rw-r----
) but zip files created with this library end up with the very odd permission of 0637 (e.g.rw--wxrwx
).I've added a failing test case to
test/file_permissions_test.rb
on my branch but haven't had time to actually write a solution nor to do any testing on windows.The text was updated successfully, but these errors were encountered: