mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Optimize symbolic links checking
This commit is contained in:
parent
e06e1d9911
commit
ee38124db7
1 changed files with 4 additions and 2 deletions
|
@ -157,8 +157,10 @@ void WebApplication::sendWebUIFile()
|
|||
if (!Utils::Fs::isRegularFile(localPath))
|
||||
throw InternalServerErrorHTTPError(tr("Unacceptable file type, only regular file is allowed."));
|
||||
|
||||
QFileInfo fileInfo {localPath.data()};
|
||||
while (Path(fileInfo.filePath()) != m_rootFolder)
|
||||
const QString rootFolder = m_rootFolder.data();
|
||||
|
||||
QFileInfo fileInfo {localPath.parentPath().data()};
|
||||
while (fileInfo.path() != rootFolder)
|
||||
{
|
||||
if (fileInfo.isSymLink())
|
||||
throw InternalServerErrorHTTPError(tr("Symlinks inside alternative UI folder are forbidden."));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue