Kernel: O_SEARCH doesn't require any permissions

Except read permissions for all directories in the path

This allows us to stat e.g. device files for which we don't have
the permissions.
This commit is contained in:
Bananymous 2023-08-11 12:25:32 +03:00
parent 9ab7e76a3b
commit 871c792976
1 changed files with 1 additions and 2 deletions

View File

@ -10,8 +10,7 @@ namespace Kernel
if (credentials.is_superuser())
return true;
// We treat O_SEARCH as O_RDONLY
if (flags & (O_RDONLY | O_SEARCH))
if (flags & O_RDONLY)
{
if (mode().mode & S_IROTH)
{ }