Kernel: Fix directory permissions

We did not care about X bit in directories and instead used only the
R bit for search/read.
This commit is contained in:
Bananymous
2023-09-08 11:46:53 +03:00
parent 660f7cbfeb
commit 39a5c52088
10 changed files with 73 additions and 34 deletions

View File

@@ -38,7 +38,7 @@ namespace Kernel
}
}
if (flags & O_EXEC)
if (flags & (O_EXEC | O_SEARCH))
{
if (mode().mode & S_IXOTH)
{ }

View File

@@ -133,7 +133,7 @@ namespace Kernel
}
else
{
if (!inode->can_access(credentials, O_RDONLY))
if (!inode->can_access(credentials, O_SEARCH))
return BAN::Error::from_errno(EACCES);
inode = TRY(inode->directory_find_inode(path_part));
@@ -152,7 +152,7 @@ namespace Kernel
auto target = TRY(inode->link_target());
if (target.empty())
return BAN::Error::from_errno(ENOENT);
if (target.front() == '/')
{
inode = root_inode();