1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 04:44:58 +00:00

Kernel: The root inode of a TmpFS should have the sticky bit set

We were running without the sticky bit and mode 777, which meant that
the /tmp directory was world-writable *without* protection.

With this fixed, it's no longer possible for everyone to steal root's
files in /tmp.
This commit is contained in:
Andreas Kling 2020-01-04 11:33:36 +01:00
parent 4398eec03c
commit e79c33eabb

View file

@ -121,7 +121,7 @@ NonnullRefPtr<TmpFSInode> TmpFSInode::create(TmpFS& fs, InodeMetadata metadata,
NonnullRefPtr<TmpFSInode> TmpFSInode::create_root(TmpFS& fs)
{
InodeMetadata metadata;
metadata.mode = 0040777;
metadata.mode = 0041777;
return create(fs, metadata, { fs.fsid(), 1 });
}