diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-07-02 17:04:08 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-07-02 17:04:08 +0000 |
commit | 08601aa5499c91be82693046a26d3a64ebce7350 (patch) | |
tree | 26cc4956b33637ad51706c62437acd52aa79f672 /ldso/util | |
parent | 77bd7bc570049ec9bc50870ab771870f96f5d8f9 (diff) |
Only exec child apps if they are elf type ET_EXEC
Diffstat (limited to 'ldso/util')
-rw-r--r-- | ldso/util/ldd.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |