mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibCoreDump+CrashDaemon: Compress coredumps
Most coredumps contain large amounts of consecutive null bytes and as such are a prime candidate for compression. This commit makes CrashDaemon compress files once the kernel finishes emitting them, as well as adds the functionality needed in LibCoreDump to then parse them.
This commit is contained in:
parent
b8f462a78b
commit
9f656b6fa9
8 changed files with 70 additions and 15 deletions
|
@ -72,7 +72,7 @@ RefPtr<FileDescription> CoreDump::create_target_file(const Process& process, con
|
|||
return nullptr;
|
||||
}
|
||||
auto dump_directory_metadata = dump_directory.value()->inode().metadata();
|
||||
if (dump_directory_metadata.uid != 0 || dump_directory_metadata.gid != 0 || dump_directory_metadata.mode != 040755) {
|
||||
if (dump_directory_metadata.uid != 0 || dump_directory_metadata.gid != 0 || dump_directory_metadata.mode != 040777) {
|
||||
dbgln("Refusing to put core dump in sketchy directory '{}'", output_directory);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ KResult CoreDump::write()
|
|||
if (result.is_error())
|
||||
return result;
|
||||
|
||||
return m_fd->chmod(0400); // Make coredump file readable
|
||||
return m_fd->chmod(0600); // Make coredump file read/writable
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue