recognize and execute dynamically linked executables
. generalize libexec slightly to get some more necessary information from ELF files, e.g. the interpreter . execute dynamically linked executables when exec()ed by VFS . switch to netbsd variant of elf32.h exclusively, solves some conflicting headers
This commit is contained in:
+6
-1
@@ -253,7 +253,7 @@ static int load_elf(struct exec_info *execi)
|
||||
proc_e = execi->proc_e;
|
||||
|
||||
/* Read the file header and extract the segment sizes. */
|
||||
r = read_header_elf(execi->image, &text_vaddr, &text_paddr,
|
||||
r = read_header_elf(execi->image, execi->image_len, &text_vaddr, &text_paddr,
|
||||
&text_filebytes, &text_membytes,
|
||||
&data_vaddr, &data_paddr,
|
||||
&data_filebytes, &data_membytes,
|
||||
@@ -262,6 +262,11 @@ static int load_elf(struct exec_info *execi)
|
||||
return(r);
|
||||
}
|
||||
|
||||
if(elf_has_interpreter(execi->image, execi->image_len, NULL, 0)) {
|
||||
printf("RS: can't execute dynamically linked executables\n");
|
||||
return ENOEXEC;
|
||||
}
|
||||
|
||||
new_uid= getuid();
|
||||
new_gid= getgid();
|
||||
allow_setuid = 0;
|
||||
|
||||
Reference in New Issue
Block a user