From 3a986b447dda9b696f85667bb5513d463d9205c7 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 1 Jul 2021 17:58:09 +0200 Subject: [PATCH] Game files that are actually recursive symlinks are now skipped during startup. --- es-app/src/SystemData.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index bb415815b..fee01b1f9 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -278,6 +278,15 @@ bool SystemData::populateFolder(FileData* folder) it != dirContent.cend(); it++) { filePath = *it; + // Skip any recursive symlinks as those would hang the application at various places. + if (Utils::FileSystem::isSymlink(filePath)) { + if (Utils::FileSystem::resolveSymlink(filePath) == + Utils::FileSystem::getFileName(filePath)) { + LOG(LogWarning) << "Skipped \"" << filePath << "\" as it's a recursive symlink"; + continue; + } + } + // Skip hidden files and folders. if (!showHiddenFiles && Utils::FileSystem::isHidden(filePath)) { LOG(LogDebug) << "SystemData::populateFolder(): Skipping hidden " <<