Skip to content

path-uri: normalize parent segments in absolute joins - #29903

Merged
anp-oai merged 5 commits into
mainfrom
codex/fix-path-uri-dotdot
Jun 24, 2026
Merged

path-uri: normalize parent segments in absolute joins#29903
anp-oai merged 5 commits into
mainfrom
codex/fix-path-uri-dotdot

Conversation

@anp-oai

@anp-oai anp-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Why

PathUri::join normalized .. for relative paths, but its absolute-path branch rebuilt URIs through url::PathSegmentsMut::push, which skips dot segments. /tmp/a/../b therefore resolved to /tmp/a/b instead of /tmp/b.

What changed

Normalize absolute native path segments before constructing the file URI. Parent traversal now clamps at POSIX roots, Windows drive roots, and UNC share roots, including paths with repeated separators.

Add platform-independent coverage for POSIX, drive, UNC, root-clamping, and repeated-separator cases.

Manual validation

  • just test -p codex-utils-path-uri

@anp-oai
anp-oai marked this pull request as ready for review June 24, 2026 20:16
@anp-oai
anp-oai requested a review from a team as a code owner June 24, 2026 20:16
@anp-oai

anp-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 114c65de04

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/utils/path-uri/src/lib.rs Outdated
@anp-oai

anp-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c111fcf6a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/utils/path-uri/src/lib.rs Outdated
@anp-oai

anp-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60aa7f9f31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/utils/path-uri/src/lib.rs Outdated
Comment thread codex-rs/utils/path-uri/src/lib.rs Outdated
@anp-oai

anp-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: b88d15f134

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/utils/path-uri/src/absolute_path_normalization.rs
@anp-oai
anp-oai enabled auto-merge (squash) June 24, 2026 22:19
@anp-oai
anp-oai merged commit 81f3404 into main Jun 24, 2026
31 checks passed
@anp-oai
anp-oai deleted the codex/fix-path-uri-dotdot branch June 24, 2026 22:33
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants