Repository navigation
fix(tests): ignore inherited setgid when checking program-cache tmp mode - #3224
mangeshraut712 wants to merge 2 commits into
Conversation
A setgid TMPDIR parent makes Linux inherit S_ISGID onto mkdir(0o700) tmp dirs. Compare only access bits so the owner-only check stays valid.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Mask mode bits in permission assertions cuda_core/tests/test_program_cache.py |
The temporary-directory and shared-root checks mask directory modes with 0o777 before asserting owner-only access. The first test’s docstring notes that inherited setgid does not affect the check. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Check that the temporary directory is owner-only even when its parent has the setgid bit [#3214] |
✅ |
Possibly related issues
Suggested labels: bug, test, cuda.core
Suggested reviewers: rparolin
Priority:
Change: Bug fix · Severity of issue fixed: Low
Merge Risk: 
Minimal · previous review 3ffee
-
This test-only change addresses the setgid-parent failure without altering production behavior.
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Closes #3214.
Problem
test_program_cache_tmp_dir_created_owner_onlycomparesstat.S_IMODE(...)to0o700. On Linux, a setgid parent (TMPDIRmode2770) makesmkdir(mode=0o700)inheritS_ISGID, so the observed mode is0o2700and the assertion fails even though access is still owner-only.Change
Mask with
& 0o777before comparing in both places that asserttmpis owner-only. Setgid on a directory only affects the group of new entries; it does not grant access.Test