mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
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:
@@ -583,8 +583,9 @@ ErrorOr<void> Process::dump_perfcore()
|
||||
auto base_filename = TRY(KString::formatted("{}_{}", name(), pid().value()));
|
||||
auto perfcore_filename = TRY(KString::formatted("{}.profile", base_filename));
|
||||
LockRefPtr<OpenFileDescription> description;
|
||||
auto credentials = this->credentials();
|
||||
for (size_t attempt = 1; attempt <= 10; ++attempt) {
|
||||
auto description_or_error = VirtualFileSystem::the().open(perfcore_filename->view(), O_CREAT | O_EXCL, 0400, current_directory(), UidAndGid { 0, 0 });
|
||||
auto description_or_error = VirtualFileSystem::the().open(credentials, perfcore_filename->view(), O_CREAT | O_EXCL, 0400, current_directory(), UidAndGid { 0, 0 });
|
||||
if (!description_or_error.is_error()) {
|
||||
description = description_or_error.release_value();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user