Skip to content

Catalog and downloads: Don't write through a link at a temp file's name (#1502) - #1779

Merged
echelon merged 1 commit into
storytold:mainfrom
endthestart:fix/1502-temp-no-follow
Oct 15, 2026
Merged

echelon merged 1 commit into
storytold:mainfrom
endthestart:fix/1502-temp-no-follow

Conversation

@endthestart

Copy link
Copy Markdown
Contributor

Saving the catalog writes <name>.tmp and then renames it, and model downloads resume from <name>.part, but both opened those names in a way that follows a symlink, so a link left there got the write instead and the file it pointed to was changed. Now whatever is at the temp name is removed first (the link itself, never its target), and the new file is created with create_new. A .part is only resumed if it's a plain file, and it's checked again right before appending.

I added a test for each, planting a link at the temp name to another file and checking that file is left alone and the save or download still works. Thanks!

Fixes #1502

bogusyogi added a commit to Orthic-Labs/ember that referenced this pull request Oct 15, 2026
…me (storytold#1502) (upstream storytold#1779)

Applied from storytold/lightcraft PR storytold#1779 (open upstream, not yet merged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon
echelon merged commit fdd05f4 into storytold:main Oct 15, 2026
@echelon

echelon commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thank you @endthestart! This landed on main in integration batch 36 (#1843).

If you haven't already, please join our Discord: https://discord.gg/artcraft. We'd love to have you there.

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.

Catalog temp files and resumable downloads follow pre-existing symlinks before verification

2 participants