diff -urN linux/fs/binfmt_elf.c linux-2.3.18-elfid/fs/binfmt_elf.c --- linux/fs/binfmt_elf.c Tue Aug 3 18:18:39 1999 +++ linux-2.3.18-elfid/fs/binfmt_elf.c Mon Sep 20 07:35:51 1999 @@ -415,8 +415,7 @@ retval = -ENOEXEC; /* First of all, some simple consistency checks */ - if (elf_ex.e_ident[0] != 0x7f || - strncmp(&elf_ex.e_ident[1], "ELF", 3) != 0) + if (strncmp(elf_ex.e_ident, ELFMAG, SELFMAG)) goto out; if (elf_ex.e_type != ET_EXEC && elf_ex.e_type != ET_DYN) @@ -538,8 +537,7 @@ (N_MAGIC(interp_ex) != QMAGIC)) interpreter_type = INTERPRETER_ELF; - if (interp_elf_ex.e_ident[0] != 0x7f || - strncmp(&interp_elf_ex.e_ident[1], "ELF", 3) != 0) + if (strncmp(interp_elf_ex.e_ident, ELFMAG, SELFMAG)) interpreter_type &= ~INTERPRETER_ELF; retval = -ELIBBAD; @@ -823,8 +821,7 @@ if (retval != sizeof(elf_ex)) goto out_putf; - if (elf_ex.e_ident[0] != 0x7f || - strncmp(&elf_ex.e_ident[1], "ELF", 3) != 0) + if (strncmp(elf_ex.e_ident, ELFMAG, SELFMAG)) goto out_putf; /* First of all, some simple consistency checks */ diff -urN linux/fs/binfmt_em86.c linux-2.3.18-elfid/fs/binfmt_em86.c --- linux/fs/binfmt_em86.c Tue Aug 3 18:18:39 1999 +++ linux-2.3.18-elfid/fs/binfmt_em86.c Fri Sep 17 16:58:21 1999 @@ -30,11 +30,8 @@ /* Make sure this is a Linux/Intel ELF executable... */ elf_ex = *((struct elfhdr *)bprm->buf); - if (elf_ex.e_ident[0] != 0x7f || - strncmp(&elf_ex.e_ident[1], "ELF",3) != 0) { + if (strncmp(elf_ex.e_ident, ELFMAG, SELFMAG)) return -ENOEXEC; - } - /* First of all, some simple consistency checks */ if ((elf_ex.e_type != ET_EXEC &&