1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:38:10 +00:00

Kernel: Avoid OpenFileDescription::absolute_path

This commit is contained in:
Ben Wiederhake 2021-10-29 21:21:26 +02:00 committed by Andreas Kling
parent d020d46846
commit 735da58d44
2 changed files with 8 additions and 6 deletions

View file

@ -739,19 +739,19 @@ KResultOr<RefPtr<OpenFileDescription>> Process::find_elf_interpreter_for_executa
auto elf_header = (ElfW(Ehdr)*)first_page;
if (!ELF::validate_elf_header(*elf_header, interp_metadata.size)) {
dbgln("exec({}): Interpreter ({}) has invalid ELF header", path, interpreter_description->absolute_path());
dbgln("exec({}): Interpreter ({}) has invalid ELF header", path, interpreter_path);
return ENOEXEC;
}
// Not using KResultOr here because we'll want to do the same thing in userspace in the RTLD
String interpreter_interpreter_path;
if (!ELF::validate_program_headers(*elf_header, interp_metadata.size, (u8*)first_page, nread, &interpreter_interpreter_path)) {
dbgln("exec({}): Interpreter ({}) has invalid ELF Program headers", path, interpreter_description->absolute_path());
dbgln("exec({}): Interpreter ({}) has invalid ELF Program headers", path, interpreter_path);
return ENOEXEC;
}
if (!interpreter_interpreter_path.is_empty()) {
dbgln("exec({}): Interpreter ({}) has its own interpreter ({})! No thank you!", path, interpreter_description->absolute_path(), interpreter_interpreter_path);
dbgln("exec({}): Interpreter ({}) has its own interpreter ({})! No thank you!", path, interpreter_path, interpreter_interpreter_path);
return ELOOP;
}