Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating a torrent with a shortcut, the client mistakes it for a folder and considers the files to which the shortcut links #21854

Open
stalkerok opened this issue Nov 15, 2024 · 2 comments

Comments

@stalkerok
Copy link
Contributor

qBittorrent & operating system versions

qBittorrent v5.0.1 (64-bit)
Qt: 6.7.3
Libtorrent: 1.2.19.0
Boost: 1.86.0
OpenSSL: 3.4.0
zlib: 1.3.1
OS: W10

What is the problem?

When creating a torrent with a shortcut, the client mistakes it for a folder and considers the files to which the shortcut links.
The first torrent was created in qBittorrent. The second one was created in Torrent File Editor. The third one was created in (God forgive me) uTorrent.
2024-11-15_222839

Steps to reproduce

Create a torrent with a shortcut inside the folder.
Try re-hashing this torrent.

Additional context

No response

Log(s) & preferences file(s)

torrents.zip

@HanabishiRecca
Copy link
Contributor

I think the best course of action is to just filter out .lnk files, same as Torrent File Editor does. They are useless on their own and most probably get into torrents by mistake.

Here

QDirIterator dirIter {m_params.sourcePath.data(), (QDir::AllDirs | QDir::NoDotAndDotDot), QDirIterator::Subdirectories};
while (dirIter.hasNext())
{
const QString filePath = dirIter.next();
dirs.append(filePath);
}

and here

QDirIterator fileIter {dir, QDir::Files};
while (fileIter.hasNext())
{
const QFileInfo fileInfo = fileIter.nextFileInfo();
const Path relFilePath = parentPath.relativePathOf(Path(fileInfo.filePath()));
tmpNames.append(relFilePath.toString());
fileSizeMap[tmpNames.last()] = fileInfo.size();
}

@stalkerok
Copy link
Contributor Author

.lnk is also used for attacks, so it should be filtered due to potential security threat.
https://www.reddit.com/r/Piracy/comments/1gjeb29
Hash 6714c11a3cf57cd9707a8ac2b218f88eb218af3f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants