summaryrefslogtreecommitdiff
path: root/libexec/ld.so/prebind/prebind.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2006-05-03 19:49:22 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2006-05-03 19:49:22 +0000
commit761ebf4c36232f15b6102a31c3bacbb8d3af8bbf (patch)
treeadd470c258b54ef0c00dea2a2bdfc2f353074d4b /libexec/ld.so/prebind/prebind.c
parent5d0dcac567671e47cd2e91a4a5a8079015533677 (diff)
checks that libraries are libaries and programs are programs. (needs cleanup)
Diffstat (limited to 'libexec/ld.so/prebind/prebind.c')
-rw-r--r--libexec/ld.so/prebind/prebind.c11
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) {