apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.95k stars 464 forks source link

Incorrect MIME type rules for image/jpeg and /x-bitmap #3284

Closed michaelrsweet closed 15 years ago

michaelrsweet commented 15 years ago

Version: 1.4rc1 CUPS.org User: twaugh.redhat

The MIME type rules for image/jpeg and image/x-bitmap try to use an 'AND' operator '&&', but there is no such thing. When the rule is parsed it is truncated at that point.

This leads to any text file beginning 'BM' being classified as image/x-bitmap.

michaelrsweet commented 15 years ago

CUPS.org User: mike

Fixed in Subversion repository.

michaelrsweet commented 15 years ago

"0001-Fixed-incorrect-operator-in-jpeg-and-bmp-MIME-type-r.patch":

From 5b17c646b1f6a314a0f9ba67f176c00616fc38fc Mon Sep 17 00:00:00 2001 From: Tim Waugh twaugh@redhat.com Date: Mon, 10 Aug 2009 09:26:19 +0100 Subject: [PATCH] Fixed incorrect operator in jpeg and bmp MIME type rules.


conf/mime.types | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/conf/mime.types b/conf/mime.types index feb4493..bf3249e 100644 --- a/conf/mime.types +++ b/conf/mime.types @@ -95,7 +95,7 @@ application/vnd.hp-HPGL hpgl \

image/gif gif string(0,GIF87a) string(0,GIF89a) image/png png string(0,<89>PNG) -image/jpeg jpeg jpg jpe string(0,) &&\ +image/jpeg jpeg jpg jpe string(0,) +\ (char(3,0xe0) char(3,0xe1) char(3,0xe2) char(3,0xe3)\ char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\ char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\ @@ -114,7 +114,7 @@ image/x-sun-raster ras string(0,<59a66a95>)

image/fpx fpx

image/x-alias pix short(8,8) short(8,24) -image/x-bitmap bmp string(0,BM) && !printable(2,14) +image/x-bitmap bmp string(0,BM) + !printable(2,14) image/x-icon ico

1.6.2.5