mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-02 02:49:15 +00:00
feat(kernel): implement handling symbolic links in paths
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
@ -40,9 +40,20 @@ namespace Execute
|
||||
return -ENOENT;
|
||||
|
||||
if (!fd->IsRegularFile())
|
||||
return -ENOEXEC;
|
||||
{
|
||||
if (fd->IsSymbolicLink())
|
||||
{
|
||||
char buffer[512];
|
||||
fd->ReadLink(buffer, sizeof(buffer));
|
||||
fd = fs->GetByPath(buffer, fd->Parent);
|
||||
if (fd == nullptr)
|
||||
return -ENOENT;
|
||||
}
|
||||
else
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
switch (GetBinaryType(Path))
|
||||
switch (GetBinaryType(fd))
|
||||
{
|
||||
case BinaryType::BinTypeELF:
|
||||
{
|
||||
|
Reference in New Issue
Block a user