1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:38:10 +00:00

Kernel: Make mknod() respect the process umask

Otherwise the /bin/mknod command would create world-writable inodes
by default (when run by superuser) which you probably don't want.
This commit is contained in:
Andreas Kling 2020-01-02 02:39:25 +01:00
parent c7eb3ff1b3
commit 3f7de2713e

View file

@ -3483,7 +3483,7 @@ int Process::sys$mknod(const char* pathname, mode_t mode, dev_t dev)
return -EPERM;
}
return VFS::the().mknod(StringView(pathname), mode, dev, current_directory());
return VFS::the().mknod(StringView(pathname), mode & ~umask(), dev, current_directory());
}
int Process::sys$dump_backtrace()