diff options
author | Andreas Kling <kling@serenityos.org> | 2022-08-21 16:02:24 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-21 16:02:24 +0200 |
commit | c3351d4b9fc83c731f122de21adf52ef015aecb1 (patch) | |
tree | 003ab8dd231db1469f807d5c9cdd2bb33303ac50 /Kernel/Syscalls/stat.cpp | |
parent | 9744dedb5008ee4c20e01166b46bc56fcbdcbd12 (diff) | |
download | serenity-c3351d4b9fc83c731f122de21adf52ef015aecb1.zip |
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.
Diffstat (limited to 'Kernel/Syscalls/stat.cpp')
-rw-r--r-- | Kernel/Syscalls/stat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/stat.cpp b/Kernel/Syscalls/stat.cpp index 89194d32d0..650c88eb83 100644 --- a/Kernel/Syscalls/stat.cpp +++ b/Kernel/Syscalls/stat.cpp @@ -41,7 +41,7 @@ ErrorOr<FlatPtr> Process::sys$stat(Userspace<Syscall::SC_stat_params const*> use return EINVAL; base = base_description->custody(); } - auto metadata = TRY(VirtualFileSystem::the().lookup_metadata(path->view(), *base, params.follow_symlinks ? 0 : O_NOFOLLOW_NOERROR)); + auto metadata = TRY(VirtualFileSystem::the().lookup_metadata(credentials(), path->view(), *base, params.follow_symlinks ? 0 : O_NOFOLLOW_NOERROR)); auto statbuf = TRY(metadata.stat()); TRY(copy_to_user(params.statbuf, &statbuf)); return 0; |