[lkml]   [2001]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: fs/exec.c and binfmt-xxx in 2.4.14
Andreas Ferber wrote:
> On Wed, Nov 21, 2001 at 05:58:26PM +0100, Heinz-Ado Arnolds wrote:
> >
> > When i now try to start an older binary in a.out format, which has a
> > magic number of 0x010b0064, it is translated with the 'new' code to a
> > request for "binfmt-0064" instead of "binfmt-267" as expected and
> > properly handled by modprobe.
> Then add
> alias binfmt-0064 binfmt_aout
> to /etc/modules.conf. Simple, isn't it?

That's a nice idea but I wouldn't rely on the fact that the third
and the fourth byte of a file are sufficient to identify the type.
If you look at the magic numbers in /etc/magic, you'll find:

0x00640107 Linux/i386 impure executable (OMAGIC)
0x00640108 Linux/i386 pure executable (NMAGIC)
0x0064010b Linux/i386 demand-paged executable (ZMAGIC)
0x006400cc Linux/i386 demand-paged executable (QMAGIC)
=0514 80386 COFF executable

It's standard to count on the first (and eventually following) bytes.

And if you look further on in /etc/magic, you'll see that there are
other file types having 0x0064 as 3rd and 4th byte.

I think it would not be a great deal to revert the changes in fs/exec.c

Thanks for your attention


Heinz-Ado Arnolds
Websystems GmbH +49 2234 1840-0 (voice)
Max-Planck-Strasse 2, 50858 Koeln, Germany +49 2234 1840-40 (fax)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.148 / U:2.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site