You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is unexpected behavior and caused some trouble with file permission errors on serving files from rails through apache.
Replicated here:
# ruby-2.0.0-p247require'tempfile'require'zip/zip'# rubyzip (0.9.9)defprint_and_chmod(file)putssprintf("%o",File.stat(file.path).mode)file.chmod(0640)putssprintf("after file.chmod: %o",File.stat(file.path).mode)File.chmod(0640,file.path)putssprintf("after File.chmod: %o",File.stat(file.path).mode)endFile.write('foo.txt','foo.txt')FileUtils.mkdir_p'temporary_dir'Tempfile.open('foo.zip','temporary_dir')do |tempfile|
puts'Before ZipOutputStream.open, Before ZipFile.open:'print_and_chmod(tempfile)Zip::ZipOutputStream.open(tempfile){ |zos| }# make sure it's a zipputs'After ZipOutputStream.open, Before ZipFile.open:'print_and_chmod(tempfile)Zip::ZipFile.open(tempfile.path,Zip::ZipFile::CREATE)do |zip|
zip.add(tempfile.path,'foo.txt')endputs'After ZipFile.open:'print_and_chmod(tempfile)endFileUtils.rm('foo.txt')
Which displays:
Before ZipOutputStream.open, Before ZipFile.open:
100600
after file.chmod: 100640
after File.chmod: 100640
After ZipOutputStream.open, Before ZipFile.open:
100640
after file.chmod: 100640
after File.chmod: 100640
After ZipFile.open:
100600
after file.chmod: 100600
after File.chmod: 100640
If you'd like me to turn this into a test for the suite, I'd be more than willing. I just need to know where to add it.
The text was updated successfully, but these errors were encountered:
…ypt-perf
* 'master' of https://github.com/rubyzip/rubyzip:
Explicitly add the released 2.1.0 Ruby version Remove branch restriction
Fix Rubinius by adding newly required gems, updating label in .travis.yml
Update README.md
Update README.md
Make File.open_buffer support Tempfiles
Version bump
Update Changelog with Ruby 1.9 requirement
Update README to reflect 1.9 requirement
Fixrubyzip#106 Set options about restoring ownerships, permissions and times. restore permissions enabled by default.
fix jRuby Building rubyzip#104Fixrubyzip#28 and rubyzip#103
disable jRuby for a while
Fixrubyzip#102 recover file permissions if zip file was exist
Add missing Zip::Entry arguments to Zip::File#get_output_stream. Fixesrubyzip#100
fix string encoding of zip64 header ids for ruby 2.0
Add read/write support for zip64 extensions
Conflicts:
lib/zip/extra_field.rb
This is unexpected behavior and caused some trouble with file permission errors on serving files from rails through apache.
Replicated here:
Which displays:
If you'd like me to turn this into a test for the suite, I'd be more than willing. I just need to know where to add it.
The text was updated successfully, but these errors were encountered: