Skip to content

fix(cache): avoid local vendor path collisions - #36355

Open
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/vendor-path-hash-collisions
Open

fix(cache): avoid local vendor path collisions#36355
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/vendor-path-hash-collisions

Conversation

@nathanwhit

Copy link
Copy Markdown
Member

Sanitized URL components in local vendor directories retained only a short digest suffix, so distinct URL components could resolve to the same file or directory.

This uses the full SHA-256 digest while shortening the readable prefix to keep hashed path components bounded. Existing hashed layouts are regenerated through the normal global-to-local cache population path.

Tests cover a previously colliding URL pair, the maximum ordinary hashed component length, and regeneration from an existing short-hash layout.

Tests

  • ./tools/format.js libs/cache_dir/local.rs libs/cache_dir/tests/integration_test.rs
  • cargo test -p deno_cache_dir -- --nocapture
  • cargo build -p deno --bin deno

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.

1 participant