elf: instead of an assert fail, return EACCES

This commit is contained in:
Matheus
2024-04-13 20:58:20 -03:00
parent 5197cdba2a
commit db13d23155
+3 -1
View File
@@ -137,7 +137,9 @@ static int load(vnode_t *vnode, elfph64_t *ph) {
int elf_load(vnode_t *vnode, void *base, void **entry, char **interpreter, auxv64list_t *auxv64) {
// TODO return ETXTBUSY if node is open for writing
__assert(vnode->type == V_TYPE_REGULAR);
if (vnode->type != V_TYPE_REGULAR)
return EACCES;
elfheader64_t header;
int err = readexact(vnode, &header, sizeof(elfheader64_t), 0);
if (err)