mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-01 18:39:16 +00:00
feat(kernel): implement handling symbolic links in paths
Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
@ -100,6 +100,12 @@ namespace Execute
|
||||
BinaryType GetBinaryType(std::string Path)
|
||||
{
|
||||
FileNode *node = fs->GetByPath(Path.c_str(), nullptr);
|
||||
if (node->IsSymbolicLink())
|
||||
{
|
||||
char buffer[512];
|
||||
node->ReadLink(buffer, sizeof(buffer));
|
||||
node = fs->GetByPath(buffer, node->Parent);
|
||||
}
|
||||
debug("Checking binary type of %s (returning %p)", Path.c_str(), node);
|
||||
assert(node != nullptr);
|
||||
return GetBinaryType(node);
|
||||
|
Reference in New Issue
Block a user