File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2534,15 +2534,19 @@ def test_program_cache_tmp_dir_created_owner_only(tmp_path):
25342534 """``tmp`` stages in-flight compiled device code before the atomic rename into
25352535 ``entries``, so it must be created owner-only (0o700) regardless of the inherited
25362536 umask. ``root``/``entries`` intentionally inherit the umask to keep deliberately
2537- shared caches working (PR #2399 review), so only ``tmp`` is asserted."""
2537+ shared caches working (PR #2399 review), so only ``tmp`` is asserted.
2538+
2539+ Compare only the access bits (``& 0o777``). A setgid parent makes Linux inherit
2540+ ``S_ISGID`` onto ``tmp``; that bit does not grant access and must not fail the
2541+ owner-only check (issue #3214)."""
25382542 import stat
25392543
25402544 from cuda .core .utils ._program_cache ._file_stream import FileStreamProgramCache
25412545
25422546 root = tmp_path / "pc"
25432547 FileStreamProgramCache (path = root )
25442548
2545- mode = stat .S_IMODE (os .stat (root / "tmp" ).st_mode )
2549+ mode = stat .S_IMODE (os .stat (root / "tmp" ).st_mode ) & 0o777
25462550 assert mode == 0o700 , f"tmp has mode { oct (mode )} "
25472551
25482552
@@ -2563,7 +2567,7 @@ def test_program_cache_preexisting_shared_root_used_as_is(tmp_path):
25632567 FileStreamProgramCache (path = root )
25642568
25652569 assert stat .S_IMODE (os .stat (root ).st_mode ) == 0o777
2566- assert stat .S_IMODE (os .stat (root / "tmp" ).st_mode ) == 0o700
2570+ assert ( stat .S_IMODE (os .stat (root / "tmp" ).st_mode ) & 0o777 ) == 0o700
25672571
25682572
25692573@pytest .mark .thread_unsafe (reason = "monkeypatches the process-global NVVM fingerprint probe" )
You can’t perform that action at this time.
0 commit comments