Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Jul 2010 14:23:24 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Polytropon <freebsd@edvax.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: 'file' Command Giving False Positives
Message-ID:  <44r5jln3oj.fsf@be-well.ilk.org>
In-Reply-To: <20100702173504.c53738b2.freebsd@edvax.de> (Polytropon's message of "Fri, 2 Jul 2010 17:35:04 %2B0200")
References:  <4C2DF07F.1020509@tundraware.com> <44630xq527.fsf@be-well.ilk.org> <20100702173504.c53738b2.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Polytropon <freebsd@edvax.de> writes:

> On Fri, 02 Jul 2010 11:25:20 -0400, Lowell Gilbert <freebsd-questions-local@be-well.ilk.org> wrote:
>> Why is it incorrect?  "LZ" as the first two bytes in a file is (unless
>> my memory is badly mistaken) exactly what the old command.com looked for
>> as the flag of an executable.
>
> If I ask *my* memory, it tells me that what you mean is "MZ". As
> far as I remember, those are the initials of a programmer involved
> with the creation of the DOS binary executable format. :-)

Apparently, your memory is better than mine, because that was indeed
what I was thinking of.  Which leads to the question of why magic(5)
lists LZ as representing "MS-DOS executable (built-in)".  I'd be
hesitant to change that unless we knew for sure it was wrong.

Even if it _is_ wrong, the "problem" still remains for "MZ" at least:
Any file starting with those letters is going to be identified as an
MS-DOS executable, and there's no clear way to distinguish it from a
text file that happens to start with those letters.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44r5jln3oj.fsf>