summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py_compile.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-27 18:51:45 (GMT)
committerGitHub <noreply@github.com>2022-06-27 18:51:45 (GMT)
commit5751530f51c1735b763aad886c023cab2ef49cdd (patch)
treeff02cb8ce09687ed57ee6c983de2a6b4418ad207 /Lib/test/test_py_compile.py
parent56f5f904968b3796dad942e87e971e7b87c571f3 (diff)
downloadcpython-5751530f51c1735b763aad886c023cab2ef49cdd.zip
cpython-5751530f51c1735b763aad886c023cab2ef49cdd.tar.gz
cpython-5751530f51c1735b763aad886c023cab2ef49cdd.tar.bz2
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. (cherry picked from commit 7e0d98ecb3f049841de9854e7a3eca3e2638e4b2) Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/test/test_py_compile.py')
-rw-r--r--Lib/test/test_py_compile.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index f494aed..a4a52b1 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