diff options
author | 1999-09-19 16:16:49 +0000 | |
---|---|---|
committer | 1999-09-19 16:16:49 +0000 | |
commit | 39e411c4e8d805ee91f4ef9c680254ed5b624d5c (patch) | |
tree | 1f2c41f60fa2a74e6096f8d4b7c8f64e1f08ff45 /sys/compat/netbsd | |
parent | use PT_NOTE to identify NetBSD ELF64 binaries (diff) | |
download | wireguard-openbsd-39e411c4e8d805ee91f4ef9c680254ed5b624d5c.tar.xz wireguard-openbsd-39e411c4e8d805ee91f4ef9c680254ed5b624d5c.zip |
improved OS brand PT_NOTE detection
Diffstat (limited to 'sys/compat/netbsd')
-rw-r--r-- | sys/compat/netbsd/netbsd_exec.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/compat/netbsd/netbsd_exec.c b/sys/compat/netbsd/netbsd_exec.c index eddf3d4f018..899d3eb57c7 100644 --- a/sys/compat/netbsd/netbsd_exec.c +++ b/sys/compat/netbsd/netbsd_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netbsd_exec.c,v 1.3 1999/09/19 13:59:22 kstailey Exp $ */ +/* $OpenBSD: netbsd_exec.c,v 1.4 1999/09/19 16:16:49 kstailey Exp $ */ /* $NetBSD: svr4_exec.c,v 1.16 1995/10/14 20:24:20 christos Exp $ */ /* @@ -98,14 +98,13 @@ netbsd_elf64_probe(p, epp, itp, pos, os) u_int8_t *os; { Elf64_Ehdr *eh = epp->ep_hdr; - char *bp, *brand; + char *bp; int error; size_t len; - - brand = elf64_check_brand(eh); - if (brand == NULL || strcmp(brand, "NetBSD")) + if (elf64_os_pt_note(p, epp, eh, "NetBSD\0", 7, 4)) return (EINVAL); + if (itp[0]) { if ((error = emul_find(p, NULL, netbsd_emul_path, itp, &bp, 0))) return (error); |