1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

Kernel+SystemServer+CrashDaemon: Better control where we put core dumps

SystemServer now creates the /tmp/coredump and /tmp/profiler_coredumps
directories at startup, ensuring that they are owned by root, and with
basic 0755 permissions.

The kernel will also now refuse to put core dumps in a directory that
doesn't fulfill the following criteria:

- Owned by 0:0
- Directory with sticky bit not set
- 0755 permissions

Fixes #4435
Fixes #4850
This commit is contained in:
Andreas Kling 2021-01-10 11:27:02 +01:00
parent f152b6f7ed
commit 190e0e1551
3 changed files with 40 additions and 12 deletions

View file

@ -74,9 +74,7 @@ static void launch_crash_reporter(const String& coredump_path)
int main()
{
static constexpr const char* coredumps_dir = "/tmp/coredump";
mkdir(coredumps_dir, 0777);
Core::DirectoryWatcher watcher { coredumps_dir };
Core::DirectoryWatcher watcher { "/tmp/coredump" };
while (true) {
auto event = watcher.wait_for_event();
ASSERT(event.has_value());