Skip to content

Commit

Permalink
Kernel: Use credentials object in Coredump:try_create_target_file
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bellamy authored and awesomekling committed Aug 21, 2022
1 parent 7881331 commit 8ef5dbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Kernel/Coredump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ ErrorOr<NonnullLockRefPtr<OpenFileDescription>> Coredump::try_create_target_file
dbgln("Refusing to put coredump in sketchy directory '{}'", output_directory);
return EINVAL;
}
auto credentials = process.credentials();
return TRY(VirtualFileSystem::the().open(
KLexicalPath::basename(output_path),
O_CREAT | O_WRONLY | O_EXCL,
S_IFREG, // We will enable reading from userspace when we finish generating the coredump file
*dump_directory,
UidAndGid { process.uid(), process.gid() }));
UidAndGid { credentials->uid(), credentials->gid() }));
}

ErrorOr<void> Coredump::write_elf_header()
Expand Down

0 comments on commit 8ef5dbe

Please sign in to comment.