From bacon@smithers.neuro.mcw.edu  Mon Jan  5 09:43:40 2004
Return-Path: <bacon@smithers.neuro.mcw.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E751D16A4D0
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Jan 2004 09:43:40 -0800 (PST)
Received: from smithers.neuro.mcw.edu (smithers.neuro.mcw.edu [141.106.106.66])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7CF5543D5C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Jan 2004 09:43:19 -0800 (PST)
	(envelope-from bacon@smithers.neuro.mcw.edu)
Received: from smithers.neuro.mcw.edu (localhost [127.0.0.1])
	by smithers.neuro.mcw.edu (8.12.9/8.12.9) with ESMTP id i05HhIXg051241
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 5 Jan 2004 11:43:18 -0600 (CST)
	(envelope-from bacon@smithers.neuro.mcw.edu)
Received: (from bacon@localhost)
	by smithers.neuro.mcw.edu (8.12.9/8.12.9/Submit) id i05HhHKd051240;
	Mon, 5 Jan 2004 11:43:17 -0600 (CST)
Message-Id: <200401051743.i05HhHKd051240@smithers.neuro.mcw.edu>
Date: Mon, 5 Jan 2004 11:43:17 -0600 (CST)
From: Jason Bacon <bacon@smithers.neuro.mcw.edu>
Reply-To: Jason Bacon <bacon@smithers.neuro.mcw.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: "file" identifies text files as "character Computer Graphics Metafile"
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         60944
>Category:       bin
>Synopsis:       "file" identifies text files as "character Computer Graphics Metafile"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 05 09:50:13 PST 2004
>Closed-Date:    Fri Jan 09 09:05:57 PST 2004
>Last-Modified:  Fri Jan 09 09:05:57 PST 2004
>Originator:     Jason Bacon
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
Medical College of Wisconsin
>Environment:
System: FreeBSD smithers.neuro.mcw.edu 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Mon Dec 29 11:34:44 CST 2003 bacon@smithers.neuro.mcw.edu:/usr/obj/usr/src/sys/smithers i386


>Description:
	The "file" command incorrectly identifies certain text files
	as "character Computer Graphics Metafile".  This occurs if the
	the file begins with the character `0' (hex 30) in byte 0 of the
	file, followed by a space (hex 20) in byte 1, which satisfies 
	the magic number test 

	0       beshort   0x3020   character Computer Graphics Metafile

	in /usr/share/misc/magic.  This problem subsequently affects apsfilter,
	which uses "file" to identify the file type, and hence disrupts 
	printing of these text files using "lpr".

>How-To-Repeat:
	Run "file" on any text file with a `0' in the first byte and
	a space in the second.

>Fix:
	Workaround: Insert whitespace (or anything else suitable for the
	type of text file you have) before the first `0' of all your ascii
	data files in order to shift it forward from byte 0 in the file,
	and cause the above magic test to fail.

	Fix: Since ascii data files beginning with a `0' are common,
	this magic number test is risky and probably inappropriate, 
	and should probably be removed from /usr/share/misc/magic.
	Of course, this will disable "file" from identifying a 
	"character Computer Graphics Metafile".
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Fri Jan 9 09:04:16 PST 2004 
State-Changed-Why:  
FreeBSD does not maintain the third-party file(1) software. 
Please file this bug report with the authors instead. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=60944 
>Unformatted:
