Skip to content

Add Windows regression test for foreign-owned paths - #2961

Merged
Sebastian Thiel (Byron) merged 1 commit into
mainfrom
gix-sec-for-admins
Sep 2, 2026
Merged

Add Windows regression test for foreign-owned paths#2961
Sebastian Thiel (Byron) merged 1 commit into
mainfrom
gix-sec-for-admins

Conversation

@Byron

@Byron Sebastian Thiel (Byron) commented Sep 2, 2026

Copy link
Copy Markdown
Member

Tasks

  • refackiew

Protect the gix-sec ownership check against treating arbitrary paths as owned by an administrator. The test independently reads the path owner and current user SIDs before asserting reduced trust, so it does not rely on the function under test to establish its precondition.

Allow GIX_TEST_FOREIGN_OWNED_PATH to select a controlled fixture. Otherwise, probe well-known Windows locations and skip cleanly when the environment has no readable foreign-owned candidate.

Validated with the automatic C:\Users\Public fallback, a C:\Windows override, and cargo test -p gix-sec.

@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: 9614c11ddd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

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

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

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

Comment thread gix-sec/tests/sec/identity.rs
<!-- agent -->
Protect the `gix-sec` ownership check against treating arbitrary paths as owned
by an administrator. The test independently reads the path owner and current
user SIDs before asserting reduced trust, so it does not rely on the function
under test to establish its precondition.

Allow `GIX_TEST_FOREIGN_OWNED_PATH` to select a controlled fixture. Otherwise,
probe well-known Windows locations and skip cleanly when the environment has no
readable foreign-owned candidate.

Validated with the automatic `C:\Users\Public` fallback, a `C:\Windows` override, and `cargo test -p gix-sec`.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
@Byron
Sebastian Thiel (Byron) merged commit 02ce93b into main Sep 2, 2026
32 checks passed
@Byron
Sebastian Thiel (Byron) deleted the gix-sec-for-admins branch September 2, 2026 04:20
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