]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python/samba: Adjust tarfile extraction filter
authorNoel Power <noel.power@suse.com>
Fri, 14 Jul 2023 13:53:29 +0000 (14:53 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 21 Jul 2023 01:25:37 +0000 (01:25 +0000)
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 <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/safe_tarfile.py

index 7a2b0382a7974f9b27dd9148bf47a2669da24424..2136617847523f4734534b7042d23ad78082a9ee 100644 (file)
@@ -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):