Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 366161 - Wrong "auto-detected" MIME types for attachments
Summary: Wrong "auto-detected" MIME types for attachments
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: Bugzilla (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bugzilla Admins
URL: https://bugs.gentoo.org/show_activity...
Whiteboard:
Keywords:
: 367983 408049 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-06 03:02 UTC by Jeroen Roovers
Modified: 2013-05-25 18:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Testing whether automatic detection is to blame, with a simple ASCII text file. (bugzilla-test.log,26 bytes, text/plain)
2011-05-06 03:02 UTC, Jeroen Roovers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers gentoo-dev 2011-05-06 03:02:21 UTC
Created attachment 272257 [details]
Testing whether automatic detection is to blame, with a simple ASCII text file.

As in for instance bug #365671, the attachment initially showed up as text/x-log, which is rather silly when it's plain text/plain and nothing else, other than that it has a .log filename extension.

I'll attach some files hoping to find out whether this is user-induced or triggered by the auto-detect feature.
Comment 1 Jeroen Roovers gentoo-dev 2011-05-06 03:03:22 UTC
Oh, so it wasn't that? So perhaps it's set like that by an erring user who thinks that text/x-log actually means something...
Comment 2 Jeroen Roovers gentoo-dev 2011-05-06 03:05:58 UTC
A search finds both new and old bugs with attachments with this MIME type.

https://bugs.gentoo.org/buglist.cgi?list_id=133309&field0-0-0=attachments.mimetype&query_format=advanced&type0-0-0=substring&value0-0-0=x-log
Comment 3 Jeroen Roovers gentoo-dev 2011-05-06 03:08:39 UTC
(In reply to comment #1)
> Oh, so it wasn't that? So perhaps it's set like that by an erring user who
> thinks that text/x-log actually means something...

I can't reproduce it, is what I meant.
Comment 4 Jeroen Roovers gentoo-dev 2011-05-10 19:29:33 UTC
https://bugs.gentoo.org/show_activity.cgi?id=365999
Comment 5 Jeroen Roovers gentoo-dev 2011-05-10 20:05:25 UTC
https://bugs.gentoo.org/show_activity.cgi?id=366095
Comment 6 Jeroen Roovers gentoo-dev 2011-05-10 20:16:22 UTC
https://bugs.gentoo.org/show_activity.cgi?id=366073
Comment 7 Jeroen Roovers gentoo-dev 2011-05-10 20:20:19 UTC
Since it's usually text/x-log I am seeing, I am pretty sure now that this is an "auto-detected" MIME type, which happens to be entirely identical to the text/plain MIME type all web browsers are already aware of.

If it is the auto-detection feature that is performing so badly, then we might as well turn it off until it is fixed.
Comment 8 Jeroen Roovers gentoo-dev 2011-05-12 17:53:38 UTC
https://bugs.gentoo.org/show_activity.cgi?id=366383
Comment 9 Jeroen Roovers gentoo-dev 2011-05-12 18:54:17 UTC
Here it was a shell script instead of the usual log "file type":

https://bugs.gentoo.org/show_activity.cgi?id=366503
Comment 10 Jeroen Roovers gentoo-dev 2011-05-17 23:59:50 UTC
https://bugs.gentoo.org/show_activity.cgi?id=367597

No idea what text/x-mpsub might be.
Comment 11 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2011-05-18 16:57:21 UTC
The TypeSniffer extension (which should do a proper auto-detection on the server side in case the browser sets it to 'application/octet-stream') has been disabled for now.
Auto-detect is still enabled but only on the client side, so most auto-detect attachments will have 'application/octet-stream'.
Comment 12 Jeroen Roovers gentoo-dev 2011-05-18 17:10:04 UTC
IIRC that's more or less exactly the behaviour that we used to have, and this should mean a lot less correction work. Let's see how it goes.
Comment 13 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2011-05-18 17:14:03 UTC
Well, that also means that a lot of log files, build.log etc. are 'application/octet-stream' due to failed detection through the browser.
Comment 14 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2011-05-19 17:14:58 UTC
*** Bug 367983 has been marked as a duplicate of this bug. ***
Comment 15 Jeroen Roovers gentoo-dev 2011-05-23 22:55:22 UTC
I have no idea how this browser detection is supposed to work, but couldn't we default to text/plain in the manual case? Most attachments are text/plain.
Comment 16 Jeroen Roovers gentoo-dev 2011-06-16 23:15:26 UTC
(In reply to comment #15)
> I have no idea how this browser detection is supposed to work, but couldn't we
> default to text/plain in the manual case? Most attachments are text/plain.

Most attachments are definitely not application/octet-stream, or maybe every single one should be, but with text/plain we would be more specific, if sometimes wrong. This is a simple workaround for the real problem of lousy file type detection that we could implement today.
Comment 17 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2011-06-16 23:31:50 UTC
The default is text/plain now, for the moment.
Comment 18 Jeroen Roovers gentoo-dev 2011-09-03 05:59:08 UTC
It seems to be working out. Maybe we can close this bug now.
Comment 19 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2012-02-28 10:15:18 UTC
Attachments: The encoding of text files can be automatically detected when uploading them as attachments.

This has been improved in Bugzilla 4.2.
It would be cool if you or others could test the improved auto-detect so we may consider to make it the default again.
Comment 20 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2013-05-23 13:04:47 UTC
Note for myself:
Bugzilla 4.4
When a user uploads a new attachment and lets the "Content Type" field set to "auto-detect", Bugzilla now does its own MIME type detection if the web browser tells him that the attachment is of type "application/octet-stream", in an attempt to make a better guess than the web browser. In all other cases, Bugzilla still trusts what the browser tells him.
Comment 21 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2013-05-23 13:04:55 UTC
*** Bug 408049 has been marked as a duplicate of this bug. ***
Comment 22 Christian Ruppert (idl0r) archtester Gentoo Infrastructure gentoo-dev Security 2013-05-25 18:18:18 UTC
Please test.