ladybird/Kernel/Syscalls
Jelle Raaijmakers 30abfc2b21 Kernel: Pass absolute path to shebang interpreter
When you invoke a binary with a shebang line, the `execve` syscall
makes sure to pass along command line arguments to the shebang
interpreter including the path to the binary to execute.

This does not work well when the binary lives in $PATH. For example,
given this script living in `/usr/local/bin/my-script`:

  #!/bin/my-interpreter
  echo "well hello friends"

When executing it as `my-script` from outside `/usr/local/bin/`, it is
executed as `/bin/my-interpreter my-script`. To make sure that the
interpreter can find the binary to execute, we need to replace the
first argument with an absolute path to the binary, so that the
resulting command is:

  /bin/my-interpreter /usr/local/bin/my-script
2021-06-13 21:19:51 +02:00
..
access.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
alarm.cpp Kernel: Remove an allocation when blocking a thread 2021-05-20 09:09:10 +02:00
anon_create.cpp Kernel: Make AnonymousFile::create API OOM safe 2021-06-01 23:14:40 +01:00
beep.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
chdir.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
chmod.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
chown.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
chroot.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
clock.cpp Kernel: Modify TimeManagement::current_time(..) API so it can't fail. (#6869) 2021-05-05 18:51:06 +02:00
debug.cpp Kernel: Rename instances of IO port 0xe9 to BOCHS_DEBUG_PORT 2021-05-31 19:06:13 +01:00
disown.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
dup2.cpp Kernel: Make dup2() return the fd even if old & new are the same (#7506) 2021-05-27 21:14:57 +02:00
emuctl.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
execve.cpp Kernel: Pass absolute path to shebang interpreter 2021-06-13 21:19:51 +02:00
exit.cpp Kernel: Don't log profile data before/after the process/thread lifetime 2021-05-30 19:03:03 +02:00
fcntl.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
fork.cpp Kernel: Switch Process to InstrusiveList from InlineLinkedList 2021-06-07 09:42:55 +02:00
ftruncate.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
futex.cpp Kernel: Check futex command if realtime clock is used 2021-04-27 09:19:55 +02:00
get_dir_entries.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
get_stack_bounds.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
getrandom.cpp Kernel: Make UserOrKernelBuffer R/W helpers return KResultOr<size_t> 2021-05-13 23:28:40 +02:00
getuid.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
hostname.cpp Kernel: Remove the now defunct LOCKER(..) macro. 2021-04-25 09:38:27 +02:00
inode_watcher.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
ioctl.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
keymap.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
kill.cpp AK+Kernel+LibELF: Remove the need for IteratorDecision::Continue 2021-05-16 10:36:52 +01:00
link.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
lseek.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
mkdir.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
mknod.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
mmap.cpp Kernel: Fix use-after-free in sys$mremap 2021-06-02 18:00:13 +02:00
module.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
mount.cpp Kernel: Handle OOM of file system in sys$mount 2021-06-01 23:14:40 +01:00
open.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
perf_event.cpp Kernel: Make perf_event() work for global profiles 2021-05-15 16:28:18 +02:00
pipe.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
pledge.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
prctl.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
process.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
profiling.cpp AK+Kernel: Disallow implicitly lifting pointers to OwnPtr's 2021-05-31 17:09:12 +04:30
ptrace.cpp Kernel: Make PrivateInodeVMObject factory APIs OOM safe 2021-05-29 09:04:05 +02:00
purge.cpp Kernel: Harden sys$purge Vector usage against OOM. 2021-04-29 20:31:15 +02:00
read.cpp Kernel: Harden sys$readv / sys$writev Vector usage against OOM. 2021-04-29 20:31:15 +02:00
readlink.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
realpath.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
rename.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
rmdir.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
sched.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
select.cpp Kernel: Avoid an allocation in sys$poll 2021-05-19 22:51:42 +02:00
sendfd.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
setpgid.cpp Kernel: Make ProcessGroup::find_or_create API OOM safe 2021-05-20 08:10:07 +02:00
setuid.cpp Kernel: Harden sys$setgroups Vector usage against OOM 2021-05-01 09:10:30 +02:00
shutdown.cpp Kernel: Print failed attempt to shutdown the machine 2021-05-17 00:30:40 +01:00
sigaction.cpp Kernel: Support null act argument for sigaction syscall 2021-04-24 23:00:28 +02:00
socket.cpp Kernel+Userspace: Implement the accept4() system call 2021-05-17 13:32:19 +02:00
stat.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
statvfs.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
sync.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
sysconf.cpp LibC: Add POSIX timer constants 2021-06-04 10:39:41 +02:00
thread.cpp Kernel: Don't log profile data before/after the process/thread lifetime 2021-05-30 19:03:03 +02:00
times.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ttyname.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
umask.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
uname.cpp Kernel: Remove the now defunct LOCKER(..) macro. 2021-04-25 09:38:27 +02:00
unlink.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
unveil.cpp Kernel: Change unveil state to dropped even when node already exists 2021-06-08 12:15:04 +02:00
utime.cpp Kernel: Convert Process::get_syscall_path_argument() to KString 2021-05-29 20:18:57 +02:00
waitid.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
write.cpp Kernel: Fix subtle race condition in sys$write implementation 2021-05-18 16:33:15 +02:00