mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02:00
Kernel: Handle O_DIRECTORY in VFS::open() instead of in each syscall
Just taking care of some FIXMEs.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 10:24:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/15f3abc8490
@@ -205,6 +205,9 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::open(StringView path, int options
|
||||
auto& inode = custody.inode();
|
||||
auto metadata = inode.metadata();
|
||||
|
||||
if ((options & O_DIRECTORY) && !metadata.is_directory())
|
||||
return KResult(-ENOTDIR);
|
||||
|
||||
bool should_truncate_file = false;
|
||||
|
||||
// NOTE: Read permission is a bit weird, since O_RDONLY == 0,
|
||||
|
||||
Reference in New Issue
Block a user