Subject: bin/20475: "file -i" returns the wrong MIME type for wav
To: None <gnats-bugs@gnats.netbsd.org>
From: None <benjamin.wong@cc.gatech.edu>
List: netbsd-bugs
Date: 02/23/2003 19:37:38
>Number:         20475
>Category:       bin
>Synopsis:       "file -i" returns the wrong MIME type for wav, avi
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 23 16:48:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Ben Wong
>Release:        NetBSD 1.6_STABLE
>Organization:
Georgia Institute of Technology
>Environment:
	
	
System: NetBSD ursula.wongs.net 1.6_STABLE NetBSD 1.6_STABLE (URSULA) #1: Sat Jan 18 00:30:41 EST 2003 root@ursula.wongs.net:/usr/src/sys/arch/i386/compile/URSULA i386
Architecture: i386
Machine: i386
>Description:
The "file" command with the -i option is supposed to output a MIME
type. However, the magic.mime file has a small typo which causes it to
add extraneous output ("audio/unknown") for WAV and AVI files.

>How-To-Repeat:
    $ file -ib Zoolander.avi 
    audio/unknown	 video/x-msvideo
    $ file -ib bodhisattva.wav | vis -t
    audio/unknown\011 audio/x-wav\011

Note that in addition to the extraneous "audio/unknown", the MIME type
for WAV files also has a superfluous TAB at the end.

>Fix:

Edit /usr/share/misc/magic.mime. Delete the phrase "audio/unknown"
from line 91. Delete the tab at the end of line 93. Rerun "magic -iC".

--- /usr/share/misc/magic.mime.orig	Sun Sep  8 15:30:50 2002
+++ /usr/share/misc/magic.mime	Sun Feb 23 19:25:06 2003
@@ -88,9 +88,9 @@
 # Microsoft WAVE format (*.wav)
 # [GRR 950115:  probably all of the shorts and longs should be leshort/lelong]
 #					Microsoft RIFF
-0	string		RIFF		audio/unknown	
+0	string		RIFF
 #					- WAVE format
->8	string		WAVE		audio/x-wav	
+>8	string		WAVE		audio/x-wav
 >8	string		AVI		video/x-msvideo
 #
 0	belong		0x2e7261fd	application/x-realaudio

>Release-Note:
>Audit-Trail:
>Unformatted: