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

SystemServer+LibCore: Move /tmp/rpc/ directory creation to SystemServer

This doesn't solve half of the problems with /tmp/rpc, but this way we
can at least make it sticky instead of having it fully world-writable
and owned by whoever was the first to bind an RPC socket.
This commit is contained in:
Andreas Kling 2021-01-10 10:32:54 +01:00
parent 795bccbf69
commit d38b9916c9
2 changed files with 15 additions and 16 deletions

View file

@ -180,6 +180,18 @@ static void mount_all_filesystems()
}
}
static void create_tmp_rpc_directory()
{
dbgln("Creating /tmp/rpc directory");
auto old_umask = umask(0);
auto rc = mkdir("/tmp/rpc", 01777);
if (rc < 0) {
perror("mkdir(/tmp/rpc)");
ASSERT_NOT_REACHED();
}
umask(old_umask);
}
int main(int, char**)
{
prepare_devfs();
@ -190,6 +202,7 @@ int main(int, char**)
}
mount_all_filesystems();
create_tmp_rpc_directory();
parse_boot_mode();
Core::EventLoop event_loop;