From 24846506302fa99646c5f3eeb47647c27891f1e5 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 10 Jan 2006 16:59:37 +1000 Subject: [PATCH] --- yaml --- r: 17790 b: refs/heads/master c: 845884d332c060b0dfc54ba5a580d0f1a99c58a2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/binfmt_flat.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 328dbf3ee79f..d7bb27524480 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 082f2c1cc7aa7aabdbf5235b788ff42e10abb399 +refs/heads/master: 845884d332c060b0dfc54ba5a580d0f1a99c58a2 diff --git a/trunk/fs/binfmt_flat.c b/trunk/fs/binfmt_flat.c index b72dc31a0970..108d56bbd0d0 100644 --- a/trunk/fs/binfmt_flat.c +++ b/trunk/fs/binfmt_flat.c @@ -442,19 +442,22 @@ static int load_flat_file(struct linux_binprm * bprm, flags = ntohl(hdr->flags); rev = ntohl(hdr->rev); - if (flags & FLAT_FLAG_KTRACE) - printk("BINFMT_FLAT: Loading file: %s\n", bprm->filename); - - if (strncmp(hdr->magic, "bFLT", 4) || - (rev != FLAT_VERSION && rev != OLD_FLAT_VERSION)) { + if (strncmp(hdr->magic, "bFLT", 4)) { /* * because a lot of people do not manage to produce good * flat binaries, we leave this printk to help them realise * the problem. We only print the error if its not a script file */ if (strncmp(hdr->magic, "#!", 2)) - printk("BINFMT_FLAT: bad magic/rev (0x%x, need 0x%x)\n", - rev, (int) FLAT_VERSION); + printk("BINFMT_FLAT: bad header magic\n"); + return -ENOEXEC; + } + + if (flags & FLAT_FLAG_KTRACE) + printk("BINFMT_FLAT: Loading file: %s\n", bprm->filename); + + if (rev != FLAT_VERSION && rev != OLD_FLAT_VERSION) { + printk("BINFMT_FLAT: bad flat file version 0x%x (supported 0x%x and 0x%x)\n", rev, FLAT_VERSION, OLD_FLAT_VERSION); return -ENOEXEC; }