From a75084ffa7db8219e7c929d1b3f2b6a80fa96b59 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 14 Jul 2023 14:53:29 +0100 Subject: [PATCH] python/samba: Adjust tarfile extraction filter The 'data_filter' is far too restrictive, this filter doesn't apply any mode bits to directories which in turn will result in unexpected directory permissions of the amongst others msg.[ls]ock directories. With 'data_filter' and a 'patched' python at best we experience CI failures with samba-ad-back1 & samba-ad-back2 CI jobs due to server startup failures, at worst user/admins will need to adjust directory permissions post backup. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15390 Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett (cherry picked from commit e401ae44b2f952fc2686065fbfb3a563e3d4066a) --- python/samba/safe_tarfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/samba/safe_tarfile.py b/python/samba/safe_tarfile.py index 7a2b0382a79..21366178475 100644 --- a/python/samba/safe_tarfile.py +++ b/python/samba/safe_tarfile.py @@ -31,7 +31,7 @@ class TarFile(UnsafeTarFile): # New in version 3.11.4 (also has been backported) # https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extraction_filter # https://peps.python.org/pep-0706/ - extraction_filter = staticmethod(tarfile.data_filter) + extraction_filter = staticmethod(tarfile.tar_filter) except AttributeError: def extract(self, member, path="", set_attrs=True, *, numeric_owner=False): -- 2.35.3