Bug 428573 - Bugzilla: silently compresses attachments
Bugzilla: silently compresses attachments
Status: CLOSED CURRENTRELEASE
Product: Bugzilla
Classification: Community
Component: Attachments/Requests (Show other bugs)
3.4
All Linux
high Severity medium (vote)
: ---
: ---
Assigned To: PnT DevOps Devs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-13 11:48 EST by Tomas Hoger
Modified: 2013-06-23 22:27 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-01-15 13:43:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test .tar file (10.00 KB, application/x-tar)
2008-04-04 14:18 EDT, Tomas Hoger
no flags Details
test .tgz file (133 bytes, application/x-gzip)
2008-04-04 14:18 EDT, Tomas Hoger
no flags Details
test .tar file (same as above) (10.00 KB, application/x-tar)
2008-09-30 07:55 EDT, Tomas Hoger
no flags Details
test .tgz file (same as above) (133 bytes, application/octet-stream)
2008-09-30 07:55 EDT, Tomas Hoger
no flags Details
test .gz file (54 bytes, application/x-gzip)
2008-09-30 08:06 EDT, Tomas Hoger
no flags Details
.tar file (bz 3.4 re-test) (10.00 KB, application/x-tar)
2010-01-15 13:14 EST, Tomas Hoger
no flags Details
.tgz file (bz 3.4 re-test) (133 bytes, application/x-compressed-tar)
2010-01-15 13:14 EST, Tomas Hoger
no flags Details
.gz file (bz 3.4 re-test) (54 bytes, application/x-gzip)
2010-01-15 13:15 EST, Tomas Hoger
no flags Details

  None (edit)
Description Tomas Hoger 2008-01-13 11:48:41 EST
When attaching (certain type) of files to bugs in BZ, files are automatically
gzipped by BZ without file name being changed or files being uncompressed when
files are served back to user.

Steps to reproduce:
1) create .tar or .tgz file (other types may be affected too)
2) attach it to BZ, leaving content-type set to "auto-detect"
3) download file again form BZ

After downloading, file has an extra level of gzip compression being applied to
it (.tar is now gzipped, .tgz is double-gzipped).
Comment 1 Tomas Hoger 2008-02-18 10:00:02 EST
Any progress with this?
Comment 2 Tomas Hoger 2008-04-04 10:10:39 EDT
Ping again.

Any progress?  This issue still exists.
Comment 3 David Lawrence 2008-04-04 13:28:38 EDT
Actually, there was a change recently to our web server config that may solve
this. I have not had a chance to verify that this problem is solved
specifically. We added "SetInputFilter DEFLATE" to our config which when it
notices Content-Encoding: gzip, it will automatically decompress the content
before passing to the cgi scripts. This might fix this. Can you verify this is
the case?

Thanks
Dave
Comment 4 Tomas Hoger 2008-04-04 14:18:14 EDT
Created attachment 301318 [details]
test .tar file
Comment 5 Tomas Hoger 2008-04-04 14:18:51 EDT
Created attachment 301319 [details]
test .tgz file
Comment 6 Tomas Hoger 2008-04-04 14:23:53 EDT
$ file test.tar
test.tar: POSIX tar archive (GNU)

$ file test.tgz
test.tgz: gzip compressed data, from Unix

$ gunzip < test.tgz > test-2.tgz

$ file test-2.tgz
test-2.tgz: gzip compressed data, from Unix, last modified: Fri Apr  4 20:17:33 2008

$ tar tzf test.tgz

$ tar tzf test-2.tgz
testfile

Still problem for .tgz .
Comment 7 David Lawrence 2008-09-16 12:55:46 EDT
Red Hat Bugzilla is now using version 3.2 of the Bugzilla codebase and therefore this bug will need to be re-verified against the new release. With the updated code this bug may no longer be relevant or may have been fixed in the new code.
Updating bug version to 3.2.
Comment 8 Tomas Hoger 2008-09-30 07:55:05 EDT
Created attachment 318062 [details]
test .tar file (same as above)
Comment 9 Tomas Hoger 2008-09-30 07:55:45 EDT
Created attachment 318063 [details]
test .tgz file (same as above)
Comment 10 Tomas Hoger 2008-09-30 07:59:36 EDT
Same status as described in comment #6, .tar files are fine, .tgz files are still double-compressed (either old or newly attached):

$ file test.tar
test.tar: POSIX tar archive (GNU)

$ file test.tgz
test.tgz: gzip compressed data, from Unix

$ gunzip < test.tgz > test-2.tgz

$ file test-2.tgz
test-2.tgz: gzip compressed data, from Unix, last modified: Fri Apr  4 20:17:33 2008
Comment 11 Tomas Hoger 2008-09-30 08:06:12 EDT
After adding attachment in comment #9, Bugzilla reported:

  Note: Red Hat Bugzilla automatically detected the content type
  application/x-gzip for this attachment. If this is incorrect, correct
  the value by editing the attachment's details.

I tried changing type to application/octet-stream and file downloads just well.  x-gzip type is probably correct, though it should not get double-compressed on download.
Comment 12 Tomas Hoger 2008-09-30 08:06:56 EDT
Created attachment 318064 [details]
test .gz file
Comment 13 Tomas Hoger 2008-09-30 08:09:03 EDT
.gz has same problem as .tgz

(after download)
$ cat testfile.gz | gunzip | gunzip
testfile for rhbz#428573
Comment 14 David Lawrence 2010-01-15 11:55:59 EST
Red Hat Bugzilla is now using version 3.4 of the Bugzilla codebase and
therefore this bug will need to be re-verified against the new release. With
the updated code this bug may no longer be relevant or may have been fixed in
the new code. Updating bug version to 3.4.
Comment 15 Tomas Hoger 2010-01-15 13:14:11 EST
Created attachment 384674 [details]
.tar file (bz 3.4 re-test)
Comment 16 Tomas Hoger 2010-01-15 13:14:45 EST
Created attachment 384675 [details]
.tgz file (bz 3.4 re-test)
Comment 17 Tomas Hoger 2010-01-15 13:15:07 EST
Created attachment 384676 [details]
.gz file (bz 3.4 re-test)
Comment 18 Tomas Hoger 2010-01-15 13:18:58 EST
Seems fixed now.  I can correctly download previously attached files (comment #8, comment #9 and comment #12), as well as newly attached ones (comment #15 - comment #17).
Comment 19 David Lawrence 2010-01-15 13:43:14 EST
Thanks for verifying.

Note You need to log in before you can comment on or make changes to this bug.