mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +00:00
Kernel: Use credentials object in Coredump:try_create_target_file
This commit is contained in:
parent
78813313f9
commit
8ef5dbed21
1 changed files with 2 additions and 1 deletions
|
@ -68,12 +68,13 @@ ErrorOr<NonnullLockRefPtr<OpenFileDescription>> Coredump::try_create_target_file
|
||||||
dbgln("Refusing to put coredump in sketchy directory '{}'", output_directory);
|
dbgln("Refusing to put coredump in sketchy directory '{}'", output_directory);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
auto credentials = process.credentials();
|
||||||
return TRY(VirtualFileSystem::the().open(
|
return TRY(VirtualFileSystem::the().open(
|
||||||
KLexicalPath::basename(output_path),
|
KLexicalPath::basename(output_path),
|
||||||
O_CREAT | O_WRONLY | O_EXCL,
|
O_CREAT | O_WRONLY | O_EXCL,
|
||||||
S_IFREG, // We will enable reading from userspace when we finish generating the coredump file
|
S_IFREG, // We will enable reading from userspace when we finish generating the coredump file
|
||||||
*dump_directory,
|
*dump_directory,
|
||||||
UidAndGid { process.uid(), process.gid() }));
|
UidAndGid { credentials->uid(), credentials->gid() }));
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<void> Coredump::write_elf_header()
|
ErrorOr<void> Coredump::write_elf_header()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue