From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 5 09:50:17 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4EFDE16A4CE for ; Mon, 5 Jan 2004 09:50:17 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23DEA43D2F for ; Mon, 5 Jan 2004 09:50:14 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i05HoEFR008702 for ; Mon, 5 Jan 2004 09:50:14 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i05HoDSw008701; Mon, 5 Jan 2004 09:50:13 -0800 (PST) (envelope-from gnats) Resent-Date: Mon, 5 Jan 2004 09:50:13 -0800 (PST) Resent-Message-Id: <200401051750.i05HoDSw008701@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jason Bacon Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E751D16A4D0 for ; 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 ; 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]) i05HhIXg051241 for ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/60944: "file" identifies text files as "character Computer Graphics Metafile" X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jason Bacon List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2004 17:50:17 -0000 >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: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 05 09:50:13 PST 2004 >Closed-Date: >Last-Modified: >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: >Unformatted: