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

fix: escape single file torrent name #6846

Merged
merged 1 commit into from
May 24, 2024
Merged

Conversation

tearfur
Copy link
Member

@tearfur tearfur commented May 18, 2024

Fixes #6799.
Regression from #2542.

Since the regression PR, Transmission does not sanitize the filename for single-file torrents.

Notes: Fixed 4.0.0 bug where the filename for single-file torrents aren't sanitized.

P.S. tr_torrent_files::makeSubpathPortable() doesn't seem like an appropriate name for what it currently does, so I'll be making another PR for it.

@tearfur tearfur added scope:core type:fix A bug fix semver:patch make backwards compatible bug fixes labels May 18, 2024
@tearfur tearfur modified the milestones: 4.0.x, 4.1.0 May 18, 2024
@tearfur tearfur removed the semver:patch make backwards compatible bug fixes label May 18, 2024
@ckerr ckerr merged commit 459c8d3 into transmission:main May 24, 2024
24 of 25 checks passed
ckerr pushed a commit that referenced this pull request May 24, 2024
@ckerr
Copy link
Member

ckerr commented May 24, 2024

cherry-picked in 4.0.x in 459c8d3

@tearfur tearfur deleted the escape-name branch May 24, 2024 15:19
@tearfur
Copy link
Member Author

tearfur commented May 24, 2024

@ckerr Please revert the 4.0.x cherry pick, this might break existing torrents. That's why I marked it for 4.1.0.

Consider a Linux user that has a torrent with a single file named Chapter 1: Introductory.pdf. Before this commit, the file name will simply be kept as-is; but with this cherry pick 4.0.x, the file name will be converted to Chapter 1_ Introductory.pdf when loaded into a tr_torrent_metainfo object, then Transmission won't be able to find the file (still named Chapter 1: Introductory.pdf on the disk).

It isn't a problem in main because of #6187.

@koberulz
Copy link

Can confirm, the latest nightly resolves the issue I was having.

@Coeur
Copy link
Collaborator

Coeur commented May 30, 2024

@ckerr Please revert the 4.0.x cherry pick, this might break existing torrents. That's why I marked it for 4.1.0.

Maybe make a PR for 4.0.x branch, @tearfur ? In case there is a 4.0.7 release one day?

@tearfur
Copy link
Member Author

tearfur commented May 30, 2024

Not too sure what you mean... This PR is in 4.0.6 now.

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

Successfully merging this pull request may close these issues.

Files with forbidden characters can't be downloaded
4 participants