We no longer return B_OK in test_executable() for executables that don't

define an entry point (like shared libraries).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17022 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-04-06 06:16:20 +00:00
parent 04a91b97bd
commit 0f0234a5d0

View File

@ -9,6 +9,7 @@
#include "runtime_loader_private.h"
#include <elf32.h>
#include <syscalls.h>
#include <user_runtime.h>
@ -267,8 +268,14 @@ test_executable(const char *name, uid_t user, gid_t group, char *invoker)
status = B_OK;
}
} else if (status == B_OK && invoker)
invoker[0] = '\0';
} else if (status == B_OK) {
struct Elf32_Ehdr *elfHeader = (struct Elf32_Ehdr *)buffer;
if (elfHeader->e_entry == NULL) {
// we don't like to open shared libraries
status = B_NOT_AN_EXECUTABLE;
} else if (invoker)
invoker[0] = '\0';
}
out:
_kern_close(fd);