Kernel: Make VirtualFileSystem functions take credentials as input

Instead of getting credentials from Process::current(), we now require
that they be provided as input to the various VFS functions.

This ensures that an atomic set of credentials is used throughout an
entire VFS operation.
This commit is contained in:
Andreas Kling 2022-08-21 16:02:24 +02:00
commit c3351d4b9f
Notes: sideshowbarker 2024-07-17 23:02:37 +09:00
33 changed files with 159 additions and 165 deletions

View file

@ -67,7 +67,7 @@ ErrorOr<FlatPtr> Process::sys$open(Userspace<Syscall::SC_open_params const*> use
base = base_description->custody();
}
auto description = TRY(VirtualFileSystem::the().open(path->view(), options, mode & ~umask(), *base));
auto description = TRY(VirtualFileSystem::the().open(credentials(), path->view(), options, mode & ~umask(), *base));
if (description->inode() && description->inode()->bound_socket())
return ENXIO;