Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > 8ee9e0642d64bd9b99ededcf4e23c94b > files > 4

mercurial-3.1.1-5.5.mga5.src.rpm

# HG changeset patch
# User Mateusz Kwapich <mitrandir@fb.com>
# Date 1458691511 25200
#      Tue Mar 22 17:05:11 2016 -0700
# Branch stable
# Node ID b732e7f2aba4c4c417278c7c7488006301551855
# Parent  cdda7b96afff3433eafdeeb83ded83a5b25b7a5b
convert: dead code removal - old git calling functions (SEC)

CVE-2016-3069 (3/5)

---
 hgext/convert/git.py |   36 ------------------------------------
 1 file changed, 36 deletions(-)

--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -30,23 +30,6 @@ class convert_git(converter_source, comm
     # cannot remove environment variable. Just assume none have
     # both issues.
     if util.safehasattr(os, 'unsetenv'):
-        def gitopen(self, s, err=None):
-            prevgitdir = os.environ.get('GIT_DIR')
-            os.environ['GIT_DIR'] = self.path
-            try:
-                if err == subprocess.PIPE:
-                    (stdin, stdout, stderr) = util.popen3(s)
-                    return stdout
-                elif err == subprocess.STDOUT:
-                    return self.popen_with_stderr(s)
-                else:
-                    return util.popen(s, 'rb')
-            finally:
-                if prevgitdir is None:
-                    del os.environ['GIT_DIR']
-                else:
-                    os.environ['GIT_DIR'] = prevgitdir
-
         def gitpipe(self, s):
             prevgitdir = os.environ.get('GIT_DIR')
             os.environ['GIT_DIR'] = self.path
@@ -59,15 +42,6 @@ class convert_git(converter_source, comm
                     os.environ['GIT_DIR'] = prevgitdir
 
     else:
-        def gitopen(self, s, err=None):
-            if err == subprocess.PIPE:
-                (sin, so, se) = util.popen3('GIT_DIR=%s %s' % (self.path, s))
-                return so
-            elif err == subprocess.STDOUT:
-                    return self.popen_with_stderr(s)
-            else:
-                return util.popen('GIT_DIR=%s %s' % (self.path, s), 'rb')
-
         def gitpipe(self, s):
             return util.popen3('GIT_DIR=%s %s' % (self.path, s))
 
@@ -86,16 +60,6 @@ class convert_git(converter_source, comm
     def gitrunlines(self, *args, **kwargs):
         return self._gitcmd(self.runlines, *args, **kwargs)
 
-    def popen_with_stderr(self, s):
-        p = subprocess.Popen(s, shell=True, bufsize=-1,
-                             close_fds=util.closefds,
-                             stdin=subprocess.PIPE,
-                             stdout=subprocess.PIPE,
-                             stderr=subprocess.STDOUT,
-                             universal_newlines=False,
-                             env=None)
-        return p.stdout
-
     def gitread(self, s):
         fh = self.gitopen(s)
         data = fh.read()