aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_flat.c
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2006-01-24 15:34:47 -0500
committerDave Kleikamp <shaggy@austin.ibm.com>2006-01-24 15:34:47 -0500
commit0a0fc0ddbe732779366ab6b1b879f62195e65967 (patch)
tree7b42490a676cf39ae0691b6859ecf7fd410f229b /fs/binfmt_flat.c
parent4d5dbd0945d9e0833dd7964a3d6ee33157f7cc7a (diff)
parent3ee68c4af3fd7228c1be63254b9f884614f9ebb2 (diff)
Merge with /home/shaggy/git/linus-clean/
Diffstat (limited to 'fs/binfmt_flat.c')
-rw-r--r--fs/binfmt_flat.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 9d6625829b99..108d56bbd0d0 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -77,8 +77,6 @@ static int load_flat_shared_library(int id, struct lib_info *p);
77static int load_flat_binary(struct linux_binprm *, struct pt_regs * regs); 77static int load_flat_binary(struct linux_binprm *, struct pt_regs * regs);
78static int flat_core_dump(long signr, struct pt_regs * regs, struct file *file); 78static int flat_core_dump(long signr, struct pt_regs * regs, struct file *file);
79 79
80extern void dump_thread(struct pt_regs *, struct user *);
81
82static struct linux_binfmt flat_format = { 80static struct linux_binfmt flat_format = {
83 .module = THIS_MODULE, 81 .module = THIS_MODULE,
84 .load_binary = load_flat_binary, 82 .load_binary = load_flat_binary,
@@ -444,19 +442,22 @@ static int load_flat_file(struct linux_binprm * bprm,
444 flags = ntohl(hdr->flags); 442 flags = ntohl(hdr->flags);
445 rev = ntohl(hdr->rev); 443 rev = ntohl(hdr->rev);
446 444
447 if (flags & FLAT_FLAG_KTRACE) 445 if (strncmp(hdr->magic, "bFLT", 4)) {
448 printk("BINFMT_FLAT: Loading file: %s\n", bprm->filename);
449
450 if (strncmp(hdr->magic, "bFLT", 4) ||
451 (rev != FLAT_VERSION && rev != OLD_FLAT_VERSION)) {
452 /* 446 /*
453 * because a lot of people do not manage to produce good 447 * because a lot of people do not manage to produce good
454 * flat binaries, we leave this printk to help them realise 448 * flat binaries, we leave this printk to help them realise
455 * the problem. We only print the error if its not a script file 449 * the problem. We only print the error if its not a script file
456 */ 450 */
457 if (strncmp(hdr->magic, "#!", 2)) 451 if (strncmp(hdr->magic, "#!", 2))
458 printk("BINFMT_FLAT: bad magic/rev (0x%x, need 0x%x)\n", 452 printk("BINFMT_FLAT: bad header magic\n");
459 rev, (int) FLAT_VERSION); 453 return -ENOEXEC;
454 }
455
456 if (flags & FLAT_FLAG_KTRACE)
457 printk("BINFMT_FLAT: Loading file: %s\n", bprm->filename);
458
459 if (rev != FLAT_VERSION && rev != OLD_FLAT_VERSION) {
460 printk("BINFMT_FLAT: bad flat file version 0x%x (supported 0x%x and 0x%x)\n", rev, FLAT_VERSION, OLD_FLAT_VERSION);
460 return -ENOEXEC; 461 return -ENOEXEC;
461 } 462 }
462 463