Skip to content

Navigation Menu

Sign up

ngclient: Bound generated target cache paths - #3065

Open
FayezBast wants to merge 1 commit into
theupdateframework:develop from
FayezBast:fix/long-target-cache-paths
Open

FayezBast wants to merge 1 commit into
theupdateframework:develop from
FayezBast:fix/long-target-cache-paths

Conversation

@FayezBast

@FayezBast FayezBast commented Nov 26, 2026

Copy link
Copy Markdown

The updater URL-encodes the entire target path into a single cache filename. A valid nested target can exceed the filesystem’s filename limit, and a filename that fits can still produce a full path that fails with ENAMETOOLONG.

This PR uses a SHA-256 digest of the target path when either limit is exceeded. Downloads and cache lookups use the same generated path. On filesystems with smaller component limits, the digest is split across path components.

Testing

All 212 unit tests passed. I also verified that on Linux a 4,095-byte path keeps its encoded filename and a 4,096-byte path uses the digest. Ruff, mypy, and Sphinx passed.

Related to #1412, where digest-based cache filenames were proposed.

Use a digest fallback when the generated cache filename or full path exceeds filesystem limits.
Signed-off-by: FayezBast <fayezbast15@gmail.com>
FayezBast requested a review from a team as a code owner November 26, 2026 00:55

This branch has not been deployed

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /