broken /usr/bin/file behaviour

Julian Field MailScanner at ecs.soton.ac.uk
Wed Nov 23 18:05:49 GMT 2005


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

The "file" command is very clever, but it doesn't get the answer right 
100% of the time, only about 99.99% of the time. It looks at the 
characters at the beginning of the file to infer what type of content is 
in the file, ignoring its filename altogether. It really is a work of 
art, it just cannot guarantee to get it right all the time.

File it as a bug in the "file" command, they should be able to expand 
the "magic" file (which holds the detection signature table) so that it 
successfully deduces that this file is in fact a text file and not a 
QuickTime movie (a very short one :-)

Greg Matthews wrote:

>Whoever wrote libmagic seems to be a fan of the BBC comedy "Are you
>being served?"
>
>create an ascii file that begins:
>I'm free
>
>and then run /usr/bin/file against it. It is reported as:
>Apple QuickTime movie file (free)
>
>Does this count as a bug - it has certainly bugged one of my users who
>has had his email blocked as a result.
>
>GREG
>  
>

-- 
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!



More information about the MailScanner mailing list