diff options
| author | 2008-06-12 22:04:55 +0000 | |
|---|---|---|
| committer | 2008-06-12 22:04:55 +0000 | |
| commit | b8fae8cecdc558ae9fc2191d246e176d9432f364 (patch) | |
| tree | bc5aa49edc6ec3a9b7b1fb3f639276444c9c2b51 /sys/compat/linux/linux_exec.c | |
| parent | add my copyright, ok djm@ (diff) | |
| download | wireguard-openbsd-b8fae8cecdc558ae9fc2191d246e176d9432f364.tar.xz wireguard-openbsd-b8fae8cecdc558ae9fc2191d246e176d9432f364.zip | |
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/linux_exec.c')
| -rw-r--r-- | sys/compat/linux/linux_exec.c | 13 |
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: |
