Skip to content

Reject sibling paths in git_repository add_prefix - #30309

Closed
tamird wants to merge 1 commit into
bazelbuild:masterfrom
tamird:tamird/fix-git-repository-prefix
Closed

tamird wants to merge 1 commit into
bazelbuild:masterfrom
tamird:tamird/fix-git-repository-prefix

Conversation

@tamird

@tamird tamird commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

git_repository checks add_prefix containment with a raw string prefix.
A normalized path can therefore select a sibling whose name shares the
checkout-root prefix, and the worker deletes that sibling before
fetching.

Require a path-component boundary (or the root itself) and cover the
destructive sibling case with a sentinel regression.

Follow-up to #29453.

@tamird
tamird marked this pull request as ready for review July 17, 2026 01:14
@github-actions github-actions Bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jul 17, 2026
@iancha1992 iancha1992 added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website and removed team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Jul 21, 2026
@tamird

tamird commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@meteorcloudy could you please take a look?

git_repository checks add_prefix containment with a raw string prefix.
A normalized path can therefore select a sibling whose name shares the
checkout-root prefix, and the worker deletes that sibling before
fetching.

Require a path-component boundary (or the root itself) and cover the
destructive sibling case with a sentinel regression.

Follow-up to bazelbuild#29453.
@tamird
tamird force-pushed the tamird/fix-git-repository-prefix branch from adb63bd to dfbb75b Compare August 21, 2026 15:10
@bazel-docs-pr-commenter

bazel-docs-pr-commenter Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

✅ Bazel docs preview is ready!

Preview URL: https://bazel-pr-30309.mintlify.app/

Updated for dfbb75bdcdffa55b1bee74284bb33b481df0bf28

@meteorcloudy meteorcloudy added awaiting-PR-merge and removed awaiting-review PR is awaiting review from an assigned reviewer labels Aug 24, 2026
@tamird
tamird deleted the tamird/fix-git-repository-prefix branch August 24, 2026 11:49
deepalak56 pushed a commit to deepalak56/bazel_deepa that referenced this pull request Dec 1, 2026
git_repository checks add_prefix containment with a raw string prefix.
A normalized path can therefore select a sibling whose name shares the
checkout-root prefix, and the worker deletes that sibling before
fetching.

Require a path-component boundary (or the root itself) and cover the
destructive sibling case with a sentinel regression.

Follow-up to bazelbuild#29453.

Closes bazelbuild#30309.

PiperOrigin-RevId: 969773896
Change-Id: I7e9fbd29625c4c8c3ec3e056c13745cdfefe929c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants