diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-06 16:29:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 18:56:51 +0200 |
commit | 511ebffd9420fb7cdc2c67d3c9a0f484dc335033 (patch) | |
tree | e8943f6146c324ac8a68bb8da19618fa70c6979a /Kernel/Syscalls/execve.cpp | |
parent | e255b5dd31e0db23ecfff2615c4e2c99e3ddb5bc (diff) | |
download | serenity-511ebffd9420fb7cdc2c67d3c9a0f484dc335033.zip |
Kernel: Improve find_elf_interpreter_for_executable() parameter names
Diffstat (limited to 'Kernel/Syscalls/execve.cpp')
-rw-r--r-- | Kernel/Syscalls/execve.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index 24624a1697..f6743068b6 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -745,11 +745,11 @@ static KResultOr<Vector<String>> find_shebang_interpreter_for_executable(char co return ENOEXEC; } -KResultOr<RefPtr<FileDescription>> Process::find_elf_interpreter_for_executable(const String& path, const ElfW(Ehdr) & main_program_header, int nread, size_t file_size) +KResultOr<RefPtr<FileDescription>> Process::find_elf_interpreter_for_executable(String const& path, ElfW(Ehdr) const& main_executable_header, size_t main_executable_header_size, size_t file_size) { // Not using KResultOr here because we'll want to do the same thing in userspace in the RTLD String interpreter_path; - if (!ELF::validate_program_headers(main_program_header, file_size, (const u8*)&main_program_header, nread, &interpreter_path)) { + if (!ELF::validate_program_headers(main_executable_header, file_size, (u8 const*)&main_executable_header, main_executable_header_size, &interpreter_path)) { dbgln("exec({}): File has invalid ELF Program headers", path); return ENOEXEC; } @@ -799,11 +799,11 @@ KResultOr<RefPtr<FileDescription>> Process::find_elf_interpreter_for_executable( return interpreter_description; } - if (main_program_header.e_type == ET_REL) { + if (main_executable_header.e_type == ET_REL) { // We can't exec an ET_REL, that's just an object file from the compiler return ENOEXEC; } - if (main_program_header.e_type == ET_DYN) { + if (main_executable_header.e_type == ET_DYN) { // If it's ET_DYN with no PT_INTERP, then it's a dynamic executable responsible // for its own relocation (i.e. it's /usr/lib/Loader.so) if (path != "/usr/lib/Loader.so") |