mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-94315: Check for DAC override capability (GH-94316)
``os.geteuid() == 0`` is not a reliable check whether the current user has the capability to bypass permission checks. Tests now probe for DAC override.
This commit is contained in:
parent
1172172453
commit
7e0d98ecb3
6 changed files with 58 additions and 22 deletions
|
@ -115,8 +115,7 @@ class PyCompileTestsBase:
|
|||
self.assertTrue(os.path.exists(self.pyc_path))
|
||||
self.assertFalse(os.path.exists(self.cache_path))
|
||||
|
||||
@unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
|
||||
'non-root user required')
|
||||
@os_helper.skip_if_dac_override
|
||||
@unittest.skipIf(os.name == 'nt',
|
||||
'cannot control directory permissions on Windows')
|
||||
@os_helper.skip_unless_working_chmod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue