python/python-2.7.7-mhlib-linkcount.patch
Jan Matejek 13e614b70b - CVE-2014-4650-CGIHTTPServer-traversal.patch: CGIHTTPServer file
disclosure and directory traversal through URL-encoded characters
  (CVE-2014-4650, bnc#885882)
- python-2.7.7-mhlib-linkcount.patch: remove link count optimizations
  that are incorrect on btrfs (and possibly other filesystems)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=166
2014-07-24 14:33:34 +00:00

53 lines
2.0 KiB
Diff

Index: Python-2.7.7/Lib/mhlib.py
===================================================================
--- Python-2.7.7.orig/Lib/mhlib.py 2014-05-31 20:58:39.000000000 +0200
+++ Python-2.7.7/Lib/mhlib.py 2014-07-24 16:08:26.049343760 +0200
@@ -156,11 +156,6 @@
"""Return the names of the subfolders in a given folder
(prefixed with the given folder name)."""
fullname = os.path.join(self.path, name)
- # Get the link count so we can avoid listing folders
- # that have no subfolders.
- nlinks = os.stat(fullname).st_nlink
- if nlinks <= 2:
- return []
subfolders = []
subnames = os.listdir(fullname)
for subname in subnames:
@@ -168,11 +163,6 @@
if os.path.isdir(fullsubname):
name_subname = os.path.join(name, subname)
subfolders.append(name_subname)
- # Stop looking for subfolders when
- # we've seen them all
- nlinks = nlinks - 1
- if nlinks <= 2:
- break
subfolders.sort()
return subfolders
@@ -183,11 +173,6 @@
def listallsubfolders(self, name):
"""Return the names of subfolders in a given folder, recursively."""
fullname = os.path.join(self.path, name)
- # Get the link count so we can avoid listing folders
- # that have no subfolders.
- nlinks = os.stat(fullname).st_nlink
- if nlinks <= 2:
- return []
subfolders = []
subnames = os.listdir(fullname)
for subname in subnames:
@@ -200,11 +185,6 @@
subsubfolders = self.listallsubfolders(
name_subname)
subfolders = subfolders + subsubfolders
- # Stop looking for subfolders when
- # we've seen them all
- nlinks = nlinks - 1
- if nlinks <= 2:
- break
subfolders.sort()
return subfolders