From: Noel Power Date: Fri, 14 Jul 2023 13:53:29 +0000 (+0100) Subject: python/samba: Adjust tarfile extraction filter X-Git-Tag: ldb-2.8.0~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e401ae44b2f952fc2686065fbfb3a563e3d4066a;p=thirdparty%2Fsamba.git 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 --- 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):