diff options
author | 2006-05-03 19:49:21 +0000 | |
---|---|---|
committer | 2006-05-03 19:49:21 +0000 | |
commit | 456e8c917d4b841f40cc6c7e2e2e83f7787bdcae (patch) | |
tree | 5e1920e17c11d8744e34618993afea14c2858672 | |
parent | When loading 'binaries' ignore libraries. (diff) | |
download | wireguard-openbsd-456e8c917d4b841f40cc6c7e2e2e83f7787bdcae.tar.xz wireguard-openbsd-456e8c917d4b841f40cc6c7e2e2e83f7787bdcae.zip |
checks that libraries are libaries and programs are programs. (needs cleanup)
-rw-r--r-- | libexec/ld.so/prebind/prebind.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libexec/ld.so/prebind/prebind.c b/libexec/ld.so/prebind/prebind.c index 6141e1bc3d9..ca414e96217 100644 --- a/libexec/ld.so/prebind/prebind.c +++ b/libexec/ld.so/prebind/prebind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prebind.c,v 1.2 2006/05/03 19:38:06 drahn Exp $ */ +/* $OpenBSD: prebind.c,v 1.3 2006/05/03 19:49:21 drahn Exp $ */ /* * Copyright (c) 2006 Dale Rahn <drahn@dalerahn.com> * @@ -290,10 +290,13 @@ load_file(const char *filename, int lib) printf("%s: wrong arch\n", filename); goto done; } - if (lib == 0) { - if (pehdr->e_type != ET_EXEC) + + if ((lib == 0) && (pehdr->e_type != ET_EXEC)) goto done; - } + + if ((lib == 1 || lib == 2) && (pehdr->e_type != ET_DYN)) + goto done; + pexe = buf; if (pehdr->e_shstrndx == 0) { |