kernel: Disallow passing O_WRONLY and O_DIRECTORY at the same time
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
349ba0acb1
commit
9184bbfef6
@ -23,7 +23,10 @@ Result<u64> sys_openat(Registers*, SyscallArgs args)
|
||||
// Caller did not pass either O_RDONLY, O_WRONLY or O_RDWR
|
||||
if ((flags & O_RDWR) == 0) { return err(EINVAL); }
|
||||
|
||||
if ((flags & O_DIRECTORY) & (flags & O_CREAT)) return err(EINVAL);
|
||||
if (flags & O_DIRECTORY)
|
||||
{
|
||||
if ((flags & O_WRONLY) || (flags & O_CREAT)) return err(EINVAL);
|
||||
}
|
||||
|
||||
int error;
|
||||
SharedPtr<VFS::Inode> parent_inode;
|
||||
|
Loading…
Reference in New Issue
Block a user