From 08601aa5499c91be82693046a26d3a64ebce7350 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 2 Jul 2003 17:04:08 +0000 Subject: Only exec child apps if they are elf type ET_EXEC --- ldso/util/ldd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ldso') diff --git a/ldso/util/ldd.c b/ldso/util/ldd.c index b7a8dfe3a..9be97cce0 100644 --- a/ldso/util/ldd.c +++ b/ldso/util/ldd.c @@ -535,7 +535,8 @@ foo: interp = find_elf_interpreter(ehdr); #ifdef __LDSO_LDD_SUPPORT - if (interp && ehdr->e_ident[EI_CLASS] == ELFCLASSM && ehdr->e_ident[EI_DATA] == ELFDATAM + if (interp && ehdr->e_type == ET_EXEC && ehdr->e_ident[EI_CLASS] == ELFCLASSM && + ehdr->e_ident[EI_DATA] == ELFDATAM && ehdr->e_ident[EI_VERSION] == EV_CURRENT && MATCH_MACHINE(ehdr->e_machine)) { struct stat statbuf; @@ -558,7 +559,7 @@ foo: /* Wait till it returns */ waitpid(pid, &status, 0); - if (WIFEXITED(status)!=0xdead) { + if (WIFEXITED(status) && WEXITSTATUS(status)==0) { return 1; } -- cgit v1.2.3