Kernel: Pass correct permission flags when opening files

Right now, permission flags passed to VFS::open() are effectively ignored, but
that is going to change.

* O_RDONLY is 0, but it's still nicer to pass it explicitly
* POSIX says that binding a Unix socket to a symlink shall fail with EADDRINUSE
This commit is contained in:
Sergey Bugaev 2020-01-19 01:04:48 +03:00 committed by Andreas Kling
commit 6466c3d750
Notes: sideshowbarker 2024-07-19 09:58:36 +09:00
4 changed files with 35 additions and 4 deletions

View file

@ -4222,7 +4222,7 @@ int Process::sys$module_load(const char* user_path, size_t path_length)
auto path = get_syscall_path_argument(user_path, path_length);
if (path.is_error())
return path.error();
auto description_or_error = VFS::the().open(path.value(), 0, 0, current_directory());
auto description_or_error = VFS::the().open(path.value(), O_RDONLY, 0, current_directory());
if (description_or_error.is_error())
return description_or_error.error();
auto& description = description_or_error.value();