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

Files with forbidden characters can't be downloaded #6799

Closed
koberulz opened this issue Apr 20, 2024 · 7 comments · Fixed by #6846
Closed

Files with forbidden characters can't be downloaded #6799

koberulz opened this issue Apr 20, 2024 · 7 comments · Fixed by #6846

Comments

@koberulz
Copy link

koberulz commented Apr 20, 2024

What is the issue?

If a torrent contains a file with a forbidden character in the filename, it throws an error and fails to download the torrent. Other clients will substitute forbidden characters with, say, underscores.

For example, "Chapter One: Introduction.pdf" is valid in Linux, and a torrent could be created for this file. But downloaded in Transmission for Windows, it will simply create a file named "Chapter One" with no file extension, then say the file cannot be downloaded due to a file system limitation. Other clients will instead download the file, successfully, as "Chapter One_ Introduction.pdf".

Which application of Transmission?

Qt app on Windows

Which version of Transmission?

4.0.5

@Coeur Coeur added the bug label Apr 20, 2024
@killemov
Copy link

For completeness: Naming Files, Paths, and Namespaces

AFAIK Windows has the most restrictions on file names. Still kind of weird that these are still OS-based instead of filesystem-based.

@Coeur
Copy link
Collaborator

Coeur commented Apr 22, 2024

I recall I fixed it in #6187. (Transmission 4.1.0 dev/nightlies)
Win32 nightlies can be downloaded at https://build.transmissionbt.com/job/trunk-win32/

We do have this same documentation link in our code, killemov:

// https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file
// Use any character in the current code page for a name, including Unicode
// characters and characters in the extended character set (128–255),
// except for the following:
[[nodiscard, maybe_unused]] auto constexpr isWin32ReservedChar(unsigned char ch) noexcept

@killemov
Copy link

Any such limitations for macOS?

Huh, the date on the referenced article is 02/26/2024, but I guess that means last updated. Also the mentioned GitHub file reference works, but the commit reference leads to some typo in documentation.

@Coeur
Copy link
Collaborator

Coeur commented Apr 22, 2024

Any such limitations for macOS?

macOS was my predilection system for investigation. No, macOS on APFS or HFS+ is not affected and behaves as a Unix-like system (only / is forbidden in filenames, which we treat as folder separators). But having an external disk/partition on NTFS with macFUSE + NTFS-3G and asking macOS Transmission to download on it is unsupported (behavior is undefined).

but the commit reference leads to some typo in documentation.

I now changed to a different commit to make it less awkward.

@Coeur Coeur added this to the 4.1.0 milestone Apr 22, 2024
@Coeur

This comment was marked as outdated.

@Coeur Coeur closed this as completed Apr 22, 2024
@Coeur Coeur added the needs testers Call for someone to see if they can reproduce an issue label Apr 22, 2024
@Coeur Coeur reopened this Apr 22, 2024
@Coeur Coeur removed the needs testers Call for someone to see if they can reproduce an issue label Apr 22, 2024
@Coeur
Copy link
Collaborator

Coeur commented Apr 22, 2024

According to #6801, it happens in Transmission 4.1.0 too. Reopening.
I don't have a Windows computer, so I can't analysis this further myself.

@tearfur
Copy link
Member

tearfur commented May 18, 2024

This is not an OS-specific bug, and it is not related with the sanitization code itself. PR already up for the fix.

@tearfur tearfur modified the milestones: 4.0.x, 4.1.0 May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants