Skip to content

fix(ergasia): download filesystem safety (reconciliation, disk guard, zip-slip) - #491

Merged
forkwright merged 1 commit into
mainfrom
fix/ergasia-download-fs
Jul 2, 2026
Merged

fix(ergasia): download filesystem safety (reconciliation, disk guard, zip-slip)#491
forkwright merged 1 commit into
mainfrom
fix/ergasia-download-fs

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Closes #360, #365, #366, #367, #452, #453, #454.

Changes

Verification

kanon gate --full green (fmt, check, advisory-parity, cargo-deny, clippy workspace, nextest, kanon lint).

… zip-slip)

- #360: reconcile_persisted_torrents rebuilds torrent_map from live
  torrents and a persisted download_id<->librqbit_id side-table, so
  persisted downloads stay manageable after restart.
- #365: get_available_space returns a Result and propagates errors instead
  of returning u64::MAX and silently bypassing the disk-space guard.
- #367: replace the blocking df subprocess and synchronous extraction with
  fs2::available_space and off-executor (spawn_blocking) extraction.
- #366: the reported ExtractedFile.path is derived from the sanitized
  actual write location.
- #452: zip extraction pre-scans and atomically refuses the whole archive
  on any symlink entry, absolute path, or path-traversal (zip-slip) before
  writing anything.
- #453: add the Seeding->Failed and Completed->Deleted state transitions.
- #454: enforce a configurable max_decompression_ratio (default 100x)
  against the declared uncompressed size to stop decompression bombs.

Closes #360
Closes #365
Closes #366
Closes #367
Closes #452
Closes #453
Closes #454

Gate-Passed: kanon 0.1.5 +stages:fmt,check,clippy,nextest,lint sha:49f3752052b311213d980fccb7ee6b1d313bc337
@forkwright
forkwright merged commit f8ec16e into main Jul 2, 2026
11 checks passed
@forkwright
forkwright deleted the fix/ergasia-download-fs branch July 2, 2026 14:35
forkwright added a commit that referenced this pull request Jul 2, 2026
…it (#493)

#491 (ergasia) changed DownloadEngine::extract to async (impl Future) so
extraction runs off the executor; #489 (syntaxis) merged a test MockEngine
whose extract was still sync. The two PRs were each internally consistent
but ergasia was tested pre-syntaxis, so the stale mock only broke the
workspace build once both landed. Make the mock extract async.

Gate-Passed: kanon 0.1.5 +stages:fmt,check,clippy,nextest,lint sha:77b78bec2dcb0e1e949146db9e7a348590cc816e

Co-authored-by: forkwright <noreply@forkwright.dev>
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.

reconcile_persisted_torrents never rebuilds torrent_map, making all persisted downloads unmanageable after restart

1 participant