summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-03-26 18:46:20 +0300
committerAndreas Kling <kling@serenityos.org>2021-03-28 20:42:33 +0200
commit9f656b6fa98439132bce394fe46f2691cb9afa90 (patch)
treeb4a17797700fba4685e2dbf8d26e8356c901bc22 /Kernel
parentb8f462a78b459466d34945ee82fb1e6bcea936ae (diff)
downloadserenity-9f656b6fa98439132bce394fe46f2691cb9afa90.zip
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.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/CoreDump.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/CoreDump.cpp b/Kernel/CoreDump.cpp
index 706f2997ab..a6a6d5db25 100644
--- a/Kernel/CoreDump.cpp
+++ b/Kernel/CoreDump.cpp
@@ -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
}
}