mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +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:
parent
9744dedb50
commit
c3351d4b9f
33 changed files with 159 additions and 165 deletions
|
@ -758,7 +758,7 @@ ErrorOr<LockRefPtr<OpenFileDescription>> Process::find_elf_interpreter_for_execu
|
|||
|
||||
if (!interpreter_path.is_empty()) {
|
||||
dbgln_if(EXEC_DEBUG, "exec({}): Using program interpreter {}", path, interpreter_path);
|
||||
auto interpreter_description = TRY(VirtualFileSystem::the().open(interpreter_path, O_EXEC, 0, current_directory()));
|
||||
auto interpreter_description = TRY(VirtualFileSystem::the().open(credentials(), interpreter_path, O_EXEC, 0, current_directory()));
|
||||
auto interp_metadata = interpreter_description->metadata();
|
||||
|
||||
VERIFY(interpreter_description->inode());
|
||||
|
@ -827,7 +827,7 @@ ErrorOr<void> Process::exec(NonnullOwnPtr<KString> path, NonnullOwnPtrVector<KSt
|
|||
// * ET_EXEC binary that just gets loaded
|
||||
// * ET_DYN binary that requires a program interpreter
|
||||
//
|
||||
auto description = TRY(VirtualFileSystem::the().open(path->view(), O_EXEC, 0, current_directory()));
|
||||
auto description = TRY(VirtualFileSystem::the().open(credentials(), path->view(), O_EXEC, 0, current_directory()));
|
||||
auto metadata = description->metadata();
|
||||
|
||||
if (!metadata.is_regular_file())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue