View Issue Details

IDProjectCategoryView StatusLast Update
0000115fileGeneralpublic2019-11-02 18:15
Reporterikrivosheev Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.37 
Summary0000115: PDF file detect fix
DescriptionA pdf file is defined as "text/c-x".
TagsNo tags attached.

Activities

ikrivosheev

2019-10-28 17:21

reporter  

0001-Detect-pdf-fix.patch (1,218 bytes)   
From db8dbf5a535358804d88e89cdcff6f5b3164f8a1 Mon Sep 17 00:00:00 2001
From: Ivan Krivosheev <py.krivosheev@gmail.com>
Date: Mon, 28 Oct 2019 20:11:35 +0300
Subject: [PATCH] Detect pdf fix

---
 magic/Magdir/pdf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/magic/Magdir/pdf b/magic/Magdir/pdf
index 5a67e86..3f44d17 100644
--- a/magic/Magdir/pdf
+++ b/magic/Magdir/pdf
@@ -4,19 +4,19 @@
 # pdf:  file(1) magic for Portable Document Format
 #
 
-0	string		%PDF-		PDF document
+0	string		%PDF		PDF document
 !:mime	application/pdf
 !:strength +60
 >5	byte		x		\b, version %c
 >7	byte		x		\b.%c
 
-0	string		\012%PDF-	PDF document
+0	string		\012%PDF	PDF document
 !:mime	application/pdf
 !:strength +60
 >6	byte		x		\b, version %c
 >8	byte		x		\b.%c
 
-0	string		\xef\xbb\xbf%PDF-	PDF document (UTF-8)
+0	string		\xef\xbb\xbf%PDF	PDF document (UTF-8)
 !:mime	application/pdf
 !:strength +60
 >6	byte		x		\b, version %c
@@ -30,7 +30,7 @@
 >5      byte            x               \b, version %c
 >7      byte            x               \b.%c
 
-0	search/256	%PDF-		PDF document
+0	search/256	%PDF		PDF document
 !:mime	application/pdf
 !:strength +60
 >&0	byte		x		\b, version %c
-- 
2.7.4

0001-Detect-pdf-fix.patch (1,218 bytes)   

christos

2019-10-30 03:02

manager   ~0003322

My guess is that this is some hand-crafted pdf file that does not follow the standard. Instead of fixing the magic I suggest that you ask the author to change his file. Quiting from: https://en.wikipedia.org/wiki/PDF:

A PDF file is a 7-bit ASCII file, except for certain elements that may have binary content. A PDF file starts with a header containing the magic number and the version of the format such as %PDF-1.7. The format is a subset of a COS ("Carousel" Object Structure) format.[15] A COS tree file consists primarily of objects, of which there are eight types:[16]

ikrivosheev

2019-10-30 14:38

reporter   ~0003324

Ok, I think we can close issue.

christos

2019-11-02 18:15

manager   ~0003326

Won't fix. Problem with hand-crafted PDF file.

Issue History

Date Modified Username Field Change
2019-10-28 17:21 ikrivosheev New Issue
2019-10-28 17:21 ikrivosheev File Added: foxit-reader-9.0.1.1049.pdf
2019-10-28 17:21 ikrivosheev File Added: 0001-Detect-pdf-fix.patch
2019-10-30 03:02 christos Assigned To => christos
2019-10-30 03:02 christos Status new => feedback
2019-10-30 03:02 christos Note Added: 0003322
2019-10-30 14:38 ikrivosheev Note Added: 0003324
2019-10-30 14:38 ikrivosheev Status feedback => assigned
2019-11-02 18:15 christos Status assigned => resolved
2019-11-02 18:15 christos Resolution open => fixed
2019-11-02 18:15 christos Note Added: 0003326