Skip to content

fix: prevent completed paths exceeding filesystem limits - #5

Merged
MrJoiny merged 1 commit into
MrJoiny:mainfrom
calmcacil:fix/limit-completed-path
Aug 21, 2026
Merged

MrJoiny merged 1 commit into
MrJoiny:mainfrom
calmcacil:fix/limit-completed-path

Conversation

@calmcacil

Copy link
Copy Markdown
Contributor

Problem

Long download display names can produce completed directory names longer than
the filesystem's per-component limit. On Linux filesystems such as ext4, this
can cause finalization to fail when TorBoxarr creates or renames the completed
directory.

Cause

CompletedPathForJob used the sanitized display name and job ID directly as a
single path component without applying a length limit.

Fix

  • Limit the completed directory component to 255 bytes.
  • Preserve the job ID suffix.
  • Avoid cutting a UTF-8 character in half.
  • Add regression coverage for a long real-world display name.

Validation

  • go test -count=1 ./...
  • go vet ./...
  • git diff --check

@calmcacil

Copy link
Copy Markdown
Contributor Author

For context, this was triggered by an anime release with the title english (japanese) - etc — an absolute menace of a release name. Combined with TorBoxarr’s job ID suffix, the resulting completed directory exceeded the filesystem’s per-component limit during finalization. The regression test is based on a similarly long real-world title.

@calmcacil
calmcacil marked this pull request as ready for review August 19, 2026 17:55
@MrJoiny

MrJoiny commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Thank you, great job.

@MrJoiny
MrJoiny merged commit 5329a80 into MrJoiny:main Aug 21, 2026
4 checks passed
@calmcacil
calmcacil deleted the fix/limit-completed-path branch August 21, 2026 16:46
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

Successfully merging this pull request may close these issues.

2 participants