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:
@@ -38,7 +38,7 @@ namespace Kernel
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & O_EXEC)
|
||||
if (flags & (O_EXEC | O_SEARCH))
|
||||
{
|
||||
if (mode().mode & S_IXOTH)
|
||||
{ }
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user