nixpkgs/pkgs/development/python-modules/zipfile2/no-setuid.patch
2023-05-21 18:42:52 +02:00

16 lines
901 B
Diff

diff --git a/zipfile2/tests/test__zipfile.py b/zipfile2/tests/test__zipfile.py
index 60f2ed2..db6e5bc 100644
--- a/zipfile2/tests/test__zipfile.py
+++ b/zipfile2/tests/test__zipfile.py
@@ -585,8 +585,8 @@ class TestsPermissionExtraction(unittest.TestCase):
if index & 1 << order:
mode |= permissions[permgroup][order]
for order in range(3):
- if specialindex & 1 << order:
- mode |= permissions['special'][order]
+ if specialindex & 1 << order and order == 0:
+ raise unittest.SkipTest("The nix build process doesn't allow you to use the setuid bit")
os.chmod(path, mode)
real_permission = os.stat(path).st_mode & 0xFFF
self.files.append((path, real_permission))