[*] harden dir traversal for removal
This commit is contained in:
parent
a80f6091c5
commit
dbd2ec78b3
@ -76,7 +76,7 @@ namespace Aurora::IO::FS
|
||||
pNext->fileName.insert(pNext->fileName.begin(), curSubDir.begin(), curSubDir.end());
|
||||
}
|
||||
|
||||
if (pNext->bExistsDirectory)
|
||||
if (pNext->bExistsDirectory && !pNext->bSymLink)
|
||||
{
|
||||
nextLevel.push_back(pNext->fileName + "/");
|
||||
nextLevel2.push_back(pNext->fileName + "/");
|
||||
|
@ -378,6 +378,13 @@ namespace Aurora::IO::FS
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (errno == ENOTDIR)
|
||||
{
|
||||
if (::unlink(pathExpanded.c_str()) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (S_ISREG(s.st_mode))
|
||||
|
Loading…
Reference in New Issue
Block a user