Repository navigation
test(fqn): guard against Unicode project-name collisions - #2950
Merged
Merged
Conversation
Two repositories whose paths differ only in a non-ASCII segment (for example /Users/dev/<CJK name A> and /Users/dev/<CJK name B>) must derive distinct project names. Before the #571 fix every non-ASCII byte was mapped to '-', so both collapsed to the same name and shared one index. The existing #571 test pins one exact string; this test pins the property that two different segments stay distinct and validator-safe. Hardening on top of the original test: each name must also contain the hex image of its own segment (e5bc80e58f91 / e5908ee7abaf), so a future mapping that keeps the names distinct without preserving the segment is caught as well. Refs #571 Distilled from #2219. Co-authored-by: lorenzozanee <[email protected]> Signed-off-by: Martin Vogel <[email protected]>
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this guards
Two repositories whose paths differ only in a non-ASCII segment (for example two
CJK folder names under the same parent directory) must get distinct project names.
Before the #571 fix every non-ASCII byte was mapped to '-', so such repositories
collapsed to the same project name and shared one index. The existing #571 test
pins one exact string; this test pins the property itself: two different non-ASCII
segments yield two different, validator-safe project names.
Hardening
On top of the original test, each name must also contain the hex image of its own
segment (
e5bc80e58f91ande5908ee7abaf). Distinct names alone would still pass ifa future mapping replaced the segment with some other unique token; this keeps the
segment itself preserved in the name.
How it was verified
build/c/test-runner fqn(ASan/UBSan test build, macOS arm64): 92 passed,0 failed; the new test passes.
src/pipeline/fqn.cemit '-'instead of hex turns the new test red (both names collapse to
Users-dev), alongwith the existing exact-string Project name strips non-ASCII (CJK) characters from path, resulting in truncated/unrecognizable names #571 test and the fix: preserve non-ASCII (CJK) path segments in auto-generated project name #624 short-name check.
distinct and validator-safe, so the original assertions still pass, but the new
hex-image assertion turns red (
strstr(first, "e5bc80e58f91") is NULL).fqn.creturns the suite to green.Tests only; no production code changes. clang-format is clean on the touched hunk.
Distilled from #2219 by @lorenzozanee (Co-authored-by on the commit); the original could not merge because its commit has no DCO sign-off, which only the author can add. Thank you for writing this guard!
Refs #571