From 761ebf4c36232f15b6102a31c3bacbb8d3af8bbf Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Wed, 3 May 2006 19:49:22 +0000 Subject: checks that libraries are libaries and programs are programs. (needs cleanup) --- libexec/ld.so/prebind/prebind.c | 11 +++++++---- 1 file 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 * @@ -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) { -- cgit v1.2.3