diff options
author | Christian Heimes <christian@python.org> | 2022-06-27 20:27:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 20:27:19 +0200 |
commit | 7e0d98ecb3f049841de9854e7a3eca3e2638e4b2 (patch) | |
tree | dbc35d553d10f812f9f4dd479c76715824a6799a /Lib/test/test_py_compile.py | |
parent | 117217245390ed3e6fe166180f052e022d296921 (diff) | |
download | cpython-7e0d98ecb3f049841de9854e7a3eca3e2638e4b2.tar.gz cpython-7e0d98ecb3f049841de9854e7a3eca3e2638e4b2.zip |
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.
Diffstat (limited to 'Lib/test/test_py_compile.py')
-rw-r--r-- | Lib/test/test_py_compile.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index f494aed42fe..a4a52b180db 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -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 |