aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python2-CVE-2018-1000802.patch
blob: 0d5bc77c84e26e5615b5a8bb433c90a0ae5025b6 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Fix CVE-2018-1000802:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000802

Taken from upstream commit (sans NEWS):
https://github.com/python/cpython/commit/d8b103b8b3ef9644805341216963a64098642435

diff --git a/Lib/shutil.py b/Lib/shutil.py
index 3462f7c5e9..0ab1a06f52 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -413,17 +413,21 @@ def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
 
     return archive_name
 
-def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False):
+def _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger):
     # XXX see if we want to keep an external call here
     if verbose:
         zipoptions = "-r"
     else:
         zipoptions = "-rq"
-    from distutils.errors import DistutilsExecError
-    from distutils.spawn import spawn
+    cmd = ["zip", zipoptions, zip_filename, base_dir]
+    if logger is not None:
+        logger.info(' '.join(cmd))
+    if dry_run:
+        return
+    import subprocess
     try:
-        spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run)
-    except DistutilsExecError:
+        subprocess.check_call(cmd)
+    except subprocess.CalledProcessError:
         # XXX really should distinguish between "couldn't find
         # external 'zip' command" and "zip failed".
         raise ExecError, \
@@ -458,7 +462,7 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
         zipfile = None
 
     if zipfile is None:
-        _call_external_zip(base_dir, zip_filename, verbose, dry_run)
+        _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger)
     else:
         if logger is not None:
             logger.info("creating '%s' and adding '%s' to it",
e' aliases....Ludovic Courtès 2019-04-27nls: Fix wrong include name....Clément Lassieur 2019-04-27nls: Update 'zh_CN' translation....Julien Lepiller 2019-04-25nls: Update 'es' translation.Julien Lepiller 2019-04-25nls: Update 'de' translation.Julien Lepiller 2019-04-25nls: Update 'fr' translation.Julien Lepiller 2019-04-24nls: Update 'fr' translation of the manual.Julien Lepiller 2019-04-24doc: Add Simplified Chinese translation....Ludovic Courtès 2019-04-24nls: Fix guix-manual.zh_CN.po....Ludovic Courtès 2019-04-24doc: Add zh_CN PO file....Ludovic Courtès 2019-04-23doc: Add Spanish translation....Miguel Ángel Arruga Vivas 2019-04-23nls: Add missing installer files....Ludovic Courtès 2019-04-17nls: Update 'de' translation.Ludovic Courtès 2019-04-17nls: Update 'de' translation of the manual.Ludovic Courtès 2019-04-15nls: Update 'fr' translation.Julien Lepiller 2019-04-13nls: Update 'fr' translation.Julien Lepiller 2019-04-02nls: Update 'de' translation of the manual.Ludovic Courtès 2019-03-16booloader: Add 'invoke/quiet'....Ludovic Courtès 2019-03-12nls: Update 'de' translation of the manual.Julien Lepiller 2019-03-06nls: Add Swedish translation....Julien Lepiller 2019-03-01nls: Update 'fr' translation of the manual.Julien Lepiller 2019-02-14nls: Update 'da' translation.Leo Famulari 2019-02-13nls: Update 'de' translation.Julien Lepiller 2019-02-13nls: Update 'da' translation.Julien Lepiller 2019-01-28nls: Update 'de' translation of the manual.Ludovic Courtès