summaryrefslogtreecommitdiff
path: root/sys/compat/freebsd
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-06-12 04:33:00 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-06-12 04:33:00 +0000
commit686fb6d90a55f9fc0f6cf0969e65468738f5ca47 (patch)
tree551e55151786c0ef5bf06ba459793baa765e3fdd /sys/compat/freebsd
parent10bd7100021123bd8ef1604bdd460bfb7c9755f9 (diff)
Do not attempt to recognize foreign ELF binaries if emulation is disabled;
also recognize modern Linux binaries without branding, but with a ``GNU'' ABI note.
Diffstat (limited to 'sys/compat/freebsd')
-rw-r--r--sys/compat/freebsd/freebsd_exec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/compat/freebsd/freebsd_exec.c b/sys/compat/freebsd/freebsd_exec.c
index 6c545c299ca..3a750dce41d 100644
--- a/sys/compat/freebsd/freebsd_exec.c
+++ b/sys/compat/freebsd/freebsd_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: freebsd_exec.c,v 1.17 2006/01/19 17:54:50 mickey Exp $ */
+/* $OpenBSD: freebsd_exec.c,v 1.18 2008/06/12 04:32:57 miod Exp $ */
/* $NetBSD: freebsd_exec.c,v 1.2 1996/05/18 16:02:08 christos Exp $ */
/*
@@ -166,6 +166,9 @@ freebsd_elf_probe(p, epp, itp, pos, os)
int error;
size_t len;
+ if (!(emul_freebsd_elf.e_flags & EMUL_ENABLED))
+ return (ENOEXEC);
+
/*
* Older FreeBSD ELF binaries use a brand; newer ones use EI_OSABI
*/