Kernel: Allow open with O_CREAT bypass file permission checks

call to open(path, O_CREAT|O_EXCL|O_RDWR, 0444) should open file as
read-write although file is created as read-only on filesystem.
This commit is contained in:
Bananymous 2024-12-03 16:17:34 +02:00
parent 2dec3a6c95
commit 0a5aacfd87
1 changed files with 1 additions and 1 deletions

View File

@ -963,7 +963,7 @@ namespace Kernel
// FIXME: There is a race condition between next two lines // FIXME: There is a race condition between next two lines
TRY(create_file_or_dir(parent_file, path, (mode & 0777) | Inode::Mode::IFREG)); TRY(create_file_or_dir(parent_file, path, (mode & 0777) | Inode::Mode::IFREG));
file = TRY(VirtualFileSystem::get().file_from_relative_path(parent_file, m_credentials, path, flags)); file = TRY(VirtualFileSystem::get().file_from_relative_path(parent_file, m_credentials, path, flags & ~O_RDWR));
} }
else else
{ {