bin/60944: "file" identifies text files as "character Computer
Graphics Metafile"
Jason Bacon
bacon at smithers.neuro.mcw.edu
Mon Jan 5 09:50:17 PST 2004
>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 at 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:
More information about the freebsd-bugs
mailing list