summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-06-12 22:04:56 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-06-12 22:04:56 +0000
commit71174107f80667c3493067033a53229bef04eb00 (patch)
tree72eaaf7eab2d0ee81e549f605fbf4592552ec754 /sys/compat/linux
parent01915f1d61bb4551d2027db4be60b7b14984c092 (diff)
Be more permissive and try to run non-branded non-static binaries if we can
find their interpreter, as the linux ld.so name is unique and not likely to be found in another /emul/foo hierarchy; allows Opera to run again. Noticed by sturm@
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_exec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c
index a5cb81d7c31..745ae181a38 100644
--- a/sys/compat/linux/linux_exec.c
+++ b/sys/compat/linux/linux_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_exec.c,v 1.28 2008/06/12 04:32:59 miod Exp $ */
+/* $OpenBSD: linux_exec.c,v 1.29 2008/06/12 22:04:55 miod Exp $ */
/* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */
/*-
@@ -494,7 +494,16 @@ linux_elf_probe(p, epp, itp, pos, os)
}
brand = elf32_check_brand(eh);
- if (brand == NULL || strcmp(brand, "Linux") != 0)
+ if (brand != NULL && strcmp(brand, "Linux") != 0)
+ return (EINVAL);
+
+ /*
+ * If this is a static binary, do not allow it to run, as it
+ * has not been identified. We'll give non-static binaries a
+ * chance to run, as the Linux ld.so name is usually unique
+ * enough to clear any amibiguity.
+ */
+ if (itp == NULL)
return (EINVAL);
recognized: