Skip to content

Preserve PowerShell relative paths in the elevated Windows sandbox - #49690

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7f142a7ffdee795c3255d4a6e79568fa9391c055
Sep 30, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7f142a7ffdee795c3255d4a6e79568fa9391c055

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Preserve PowerShell relative paths in the elevated Windows sandbox

Why

An inaccessible user profile directory can prevent sandboxed PowerShell from preserving its working directory and resolving relative paths in a project beneath that profile.

What changed

Pass USERPROFILE to elevated setup and refresh. When the command's working directory is beneath an absolute profile path, grant the sandbox group non-inheriting FILE_READ_ATTRIBUTES access to the profile directory.

Preserve existing permissions and deny ACEs during non-inheriting ACL updates without propagating changes to descendants. Expand generic deny masks when checking for conflicting permissions.

Testing

Add a Windows regression test that checks PowerShell's working directory and reading .\public.txt beneath a protected profile. Add an ACL test that verifies a non-inheriting grant leaves an unprotected child's security descriptor unchanged.

…49690)

## Why

An inaccessible user profile directory can prevent sandboxed PowerShell from preserving its working directory and resolving relative paths in a project beneath that profile.

## What changed

Pass `USERPROFILE` to elevated setup and refresh. When the command's working directory is beneath an absolute profile path, grant the sandbox group non-inheriting `FILE_READ_ATTRIBUTES` access to the profile directory.

Preserve existing permissions and deny ACEs during non-inheriting ACL updates without propagating changes to descendants. Expand generic deny masks when checking for conflicting permissions.

## Testing

Add a Windows regression test that checks PowerShell's working directory and reading `.\public.txt` beneath a protected profile. Add an ACL test that verifies a non-inheriting grant leaves an unprotected child's security descriptor unchanged.

GitOrigin-RevId: 7f142a7ffdee795c3255d4a6e79568fa9391c055
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/7f142a7ffdee795c3255d4a6e79568fa9391c055 branch from d5248d4 to 7e8878f Compare September 30, 2026 17:51
@copyberry
copyberry Bot merged commit 7e8878f into main Sep 30, 2026
1 check failed
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/7f142a7ffdee795c3255d4a6e79568fa9391c055 branch September 30, 2026 17:51
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 30, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 7e8878f6 Deployed Sep 30, 2026 by mdavies via Identify potential duplicates (open issues fallback) #50255
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