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
commit 3f7de2713e
Notes: sideshowbarker 2024-07-19 10:26:50 +09:00

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()