Skip to content

Commit c217786

Browse files
committed
Initial import of CentoOS 6 package
1 parent 5737803 commit c217786

File tree

93 files changed

+14003
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+14003
-1
lines changed

CVE-2013-1752.patch

+747
Large diffs are not rendered by default.

CVE-2014-1912.patch

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
2+
--- a/Lib/test/test_socket.py
3+
+++ b/Lib/test/test_socket.py
4+
@@ -1620,6 +1620,16 @@ class BufferIOTest(SocketConnectedTest):
5+
6+
_testRecvFromIntoMemoryview = _testRecvFromIntoArray
7+
8+
+ def testRecvFromIntoSmallBuffer(self):
9+
+ # See issue #20246.
10+
+ buf = bytearray(8)
11+
+ self.assertRaises(ValueError, self.cli_conn.recvfrom_into, buf, 1024)
12+
+
13+
+ def _testRecvFromIntoSmallBuffer(self):
14+
+ with test_support.check_py3k_warnings():
15+
+ buf = buffer(MSG*2048)
16+
+ self.serv_conn.send(buf)
17+
+
18+
19+
TIPC_STYPE = 2000
20+
TIPC_LOWER = 200
21+
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
22+
--- a/Modules/socketmodule.c
23+
+++ b/Modules/socketmodule.c
24+
@@ -2742,6 +2742,10 @@ sock_recvfrom_into(PySocketSockObject *s
25+
if (recvlen == 0) {
26+
/* If nbytes was not specified, use the buffer's length */
27+
recvlen = buflen;
28+
+ } else if (recvlen > buflen) {
29+
+ PyErr_SetString(PyExc_ValueError,
30+
+ "nbytes is greater than the length of the buffer");
31+
+ return NULL;
32+
}
33+
34+
readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);
35+

CVE-2014-4650.patch

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# HG changeset patch
3+
# User Benjamin Peterson <benjamin@python.org>
4+
# Date 1402796189 25200
5+
# Node ID b4bab078876811c7d95231d08aa6fa7142fdda66
6+
# Parent bb8b0c7fefd0c5ed99b3f336178a4f9554a1d0ef
7+
url unquote the path before checking if it refers to a CGI script (closes #21766)
8+
9+
diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py
10+
--- a/Lib/CGIHTTPServer.py
11+
+++ b/Lib/CGIHTTPServer.py
12+
@@ -84,7 +84,7 @@ class CGIHTTPRequestHandler(SimpleHTTPSe
13+
path begins with one of the strings in self.cgi_directories
14+
(and the next character is a '/' or the end of the string).
15+
"""
16+
- splitpath = _url_collapse_path_split(self.path)
17+
+ splitpath = _url_collapse_path_split(urllib.unquote(self.path))
18+
if splitpath[0] in self.cgi_directories:
19+
self.cgi_info = splitpath
20+
return True
21+
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
22+
--- a/Lib/test/test_httpservers.py
23+
+++ b/Lib/test/test_httpservers.py
24+
@@ -510,6 +510,11 @@ class CGIHTTPServerTestCase(BaseTestCase
25+
(res.read(), res.getheader('Content-type'), res.status))
26+
self.assertEqual(os.environ['SERVER_SOFTWARE'], signature)
27+
28+
+ def test_urlquote_decoding_in_cgi_check(self):
29+
+ res = self.request('/cgi-bin%2ffile1.py')
30+
+ self.assertEqual((b'Hello World\n', 'text/html', 200),
31+
+ (res.read(), res.getheader('Content-type'), res.status))
32+
+
33+
34+
class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
35+
""" Test url parsing """

CVE-2014-7185.patch

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
2+
--- a/Lib/test/test_buffer.py
3+
+++ b/Lib/test/test_buffer.py
4+
@@ -4,6 +4,7 @@ For now, tests just new or changed funct
5+
6+
"""
7+
8+
+import sys
9+
import unittest
10+
from test import test_support
11+
12+
@@ -29,6 +30,11 @@ class BufferTests(unittest.TestCase):
13+
m = memoryview(b) # Should not raise an exception
14+
self.assertEqual(m.tobytes(), s)
15+
16+
+ def test_large_buffer_size_and_offset(self):
17+
+ data = bytearray('hola mundo')
18+
+ buf = buffer(data, sys.maxsize, sys.maxsize)
19+
+ self.assertEqual(buf[:4096], "")
20+
+
21+
22+
def test_main():
23+
with test_support.check_py3k_warnings(("buffer.. not supported",
24+
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c
25+
--- a/Objects/bufferobject.c
26+
+++ b/Objects/bufferobject.c
27+
@@ -88,7 +88,7 @@ get_buf(PyBufferObject *self, void **ptr
28+
*size = count;
29+
else
30+
*size = self->b_size;
31+
- if (offset + *size > count)
32+
+ if (*size > count - offset)
33+
*size = count - offset;
34+
}
35+
return 1;

Python-2.2.1-pydocnogui.patch

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--- Python-2.2.1/Lib/pydoc.py.nogui 2002-07-08 18:32:47.000000000 -0400
2+
+++ Python-2.2.1/Lib/pydoc.py 2002-07-08 18:33:37.000000000 -0400
3+
@@ -18,9 +18,6 @@
4+
Run "pydoc -p <port>" to start an HTTP server on a given port on the
5+
local machine to generate documentation web pages.
6+
7+
-For platforms without a command line, "pydoc -g" starts the HTTP server
8+
-and also pops up a little window for controlling it.
9+
-
10+
Run "pydoc -w <name>" to write out the HTML documentation for a module
11+
to a file named "<name>.html".
12+
"""
13+
@@ -2043,9 +2040,6 @@
14+
writing = 0
15+
16+
for opt, val in opts:
17+
- if opt == '-g':
18+
- gui()
19+
- return
20+
if opt == '-k':
21+
apropos(val)
22+
return
23+
@@ -2099,13 +2093,10 @@
24+
%s -p <port>
25+
Start an HTTP server on the given port on the local machine.
26+
27+
-%s -g
28+
- Pop up a graphical interface for finding and serving documentation.
29+
-
30+
%s -w <name> ...
31+
Write out the HTML documentation for a module to a file in the current
32+
directory. If <name> contains a '%s', it is treated as a filename; if
33+
it names a directory, documentation is written for all the contents.
34+
-""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep)
35+
+""" % (cmd, os.sep, cmd, cmd, cmd, os.sep)
36+
37+
if __name__ == '__main__': cli()

dead.package

-1
This file was deleted.
+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
diff -up Python-2.6.6/configure.in.disable-pymalloc-on-valgrind Python-2.6.6/configure.in
2+
--- Python-2.6.6/configure.in.disable-pymalloc-on-valgrind 2010-11-29 15:45:07.199350502 -0500
3+
+++ Python-2.6.6/configure.in 2010-11-29 15:45:07.208351260 -0500
4+
@@ -2538,6 +2538,19 @@ then
5+
fi
6+
AC_MSG_RESULT($with_pymalloc)
7+
8+
+# Check for Valgrind support
9+
+AC_MSG_CHECKING([for --with-valgrind])
10+
+AC_ARG_WITH([valgrind],
11+
+ AC_HELP_STRING([--with-valgrind], [Enable Valgrind support]),,
12+
+ with_valgrind=no)
13+
+AC_MSG_RESULT([$with_valgrind])
14+
+if test "$with_valgrind" != no; then
15+
+ AC_CHECK_HEADER([valgrind/valgrind.h],
16+
+ [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when running under valgrind])],
17+
+ [AC_MSG_ERROR([Valgrind support requested but headers not available])]
18+
+ )
19+
+fi
20+
+
21+
# Check for --with-wctype-functions
22+
AC_MSG_CHECKING(for --with-wctype-functions)
23+
AC_ARG_WITH(wctype-functions,
24+
diff -up Python-2.6.6/Misc/NEWS.disable-pymalloc-on-valgrind Python-2.6.6/Misc/NEWS
25+
--- Python-2.6.6/Misc/NEWS.disable-pymalloc-on-valgrind 2010-08-23 19:37:56.000000000 -0400
26+
+++ Python-2.6.6/Misc/NEWS 2010-11-29 15:45:07.209350567 -0500
27+
@@ -21,6 +21,11 @@ What's New in Python 2.6.6 rc 2?
28+
29+
*Release date: 2010-08-16*
30+
31+
+- Issue #2422: When compiled with the ``--with-valgrind`` option, the
32+
+ pymalloc allocator will be automatically disabled when running under
33+
+ Valgrind. This gives improved memory leak detection when running
34+
+ under Valgrind, while taking advantage of pymalloc at other times.
35+
+
36+
Library
37+
-------
38+
39+
diff -up Python-2.6.6/Objects/obmalloc.c.disable-pymalloc-on-valgrind Python-2.6.6/Objects/obmalloc.c
40+
--- Python-2.6.6/Objects/obmalloc.c.disable-pymalloc-on-valgrind 2010-05-09 11:15:40.000000000 -0400
41+
+++ Python-2.6.6/Objects/obmalloc.c 2010-11-29 15:45:07.209350567 -0500
42+
@@ -2,6 +2,21 @@
43+
44+
#ifdef WITH_PYMALLOC
45+
46+
+#ifdef WITH_VALGRIND
47+
+#include <valgrind/valgrind.h>
48+
+
49+
+/* If we're using GCC, use __builtin_expect() to reduce overhead of
50+
+ the valgrind checks */
51+
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
52+
+# define UNLIKELY(value) __builtin_expect((value), 0)
53+
+#else
54+
+# define UNLIKELY(value) (value)
55+
+#endif
56+
+
57+
+/* -1 indicates that we haven't checked that we're running on valgrind yet. */
58+
+static int running_on_valgrind = -1;
59+
+#endif
60+
+
61+
/* An object allocator for Python.
62+
63+
Here is an introduction to the layers of the Python memory architecture,
64+
@@ -737,6 +752,13 @@ PyObject_Malloc(size_t nbytes)
65+
if (nbytes > PY_SSIZE_T_MAX)
66+
return NULL;
67+
68+
+#ifdef WITH_VALGRIND
69+
+ if (UNLIKELY(running_on_valgrind == -1))
70+
+ running_on_valgrind = RUNNING_ON_VALGRIND;
71+
+ if (UNLIKELY(running_on_valgrind))
72+
+ goto redirect;
73+
+#endif
74+
+
75+
/*
76+
* This implicitly redirects malloc(0).
77+
*/
78+
@@ -927,6 +949,11 @@ PyObject_Free(void *p)
79+
if (p == NULL) /* free(NULL) has no effect */
80+
return;
81+
82+
+#ifdef WITH_VALGRIND
83+
+ if (UNLIKELY(running_on_valgrind > 0))
84+
+ goto redirect;
85+
+#endif
86+
+
87+
pool = POOL_ADDR(p);
88+
if (Py_ADDRESS_IN_RANGE(p, pool)) {
89+
/* We allocated this address. */
90+
@@ -1121,6 +1148,7 @@ PyObject_Free(void *p)
91+
return;
92+
}
93+
94+
+redirect:
95+
/* We didn't allocate this address. */
96+
free(p);
97+
}
98+
@@ -1150,6 +1178,12 @@ PyObject_Realloc(void *p, size_t nbytes)
99+
if (nbytes > PY_SSIZE_T_MAX)
100+
return NULL;
101+
102+
+#ifdef WITH_VALGRIND
103+
+ /* Treat running_on_valgrind == -1 the same as 0 */
104+
+ if (UNLIKELY(running_on_valgrind > 0))
105+
+ goto redirect;
106+
+#endif
107+
+
108+
pool = POOL_ADDR(p);
109+
if (Py_ADDRESS_IN_RANGE(p, pool)) {
110+
/* We're in charge of this block */
111+
@@ -1177,6 +1211,7 @@ PyObject_Realloc(void *p, size_t nbytes)
112+
}
113+
return bp;
114+
}
115+
+redirect:
116+
/* We're not managing this block. If nbytes <=
117+
* SMALL_REQUEST_THRESHOLD, it's tempting to try to take over this
118+
* block. However, if we do, we need to copy the valid data from
119+
diff -up Python-2.6.6/pyconfig.h.in.disable-pymalloc-on-valgrind Python-2.6.6/pyconfig.h.in
120+
--- Python-2.6.6/pyconfig.h.in.disable-pymalloc-on-valgrind 2009-10-27 08:30:12.000000000 -0400
121+
+++ Python-2.6.6/pyconfig.h.in 2010-11-29 15:45:07.209350567 -0500
122+
@@ -1085,6 +1085,9 @@
123+
/* Define to empty if the keyword does not work. */
124+
#undef volatile
125+
126+
+/* Define if you want pymalloc to be disabled when running under valgrind */
127+
+#undef WITH_VALGRIND
128+
+
129+
130+
/* Define the macros needed if on a UnixWare 7.x system. */
131+
#if defined(__USLC__) && defined(__SCO_VERSION__)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# HG changeset patch
2+
# User Antoine Pitrou <solipsis@pitrou.net>
3+
# Date 1259423758 0
4+
# Node ID 83c702c17e0218df96592eb27a97a8ba63c747e0
5+
# Parent 14ee75b86a5f041d531bcb41e62947bdeecfc7d1
6+
Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert Collins.
7+
8+
diff --git a/Lib/copy.py b/Lib/copy.py
9+
--- a/Lib/copy.py
10+
+++ b/Lib/copy.py
11+
@@ -260,6 +260,10 @@ d[dict] = _deepcopy_dict
12+
if PyStringMap is not None:
13+
d[PyStringMap] = _deepcopy_dict
14+
15+
+def _deepcopy_method(x, memo): # Copy instance methods
16+
+ return type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class)
17+
+_deepcopy_dispatch[types.MethodType] = _deepcopy_method
18+
+
19+
def _keep_alive(x, memo):
20+
"""Keeps a reference to the object x in the memo.
21+
22+
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py
23+
--- a/Lib/test/test_copy.py
24+
+++ b/Lib/test/test_copy.py
25+
@@ -672,6 +672,17 @@ class TestCopy(unittest.TestCase):
26+
bar = lambda: None
27+
self.assertEqual(copy.deepcopy(bar), bar)
28+
29+
+ def test_deepcopy_bound_method(self):
30+
+ class Foo(object):
31+
+ def m(self):
32+
+ pass
33+
+ f = Foo()
34+
+ f.b = f.m
35+
+ g = copy.deepcopy(f)
36+
+ self.assertEqual(g.m, g.b)
37+
+ self.assertTrue(g.b.im_self is g)
38+
+ g.b()
39+
+
40+
def global_foo(x, y): return x+y
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Index: Modules/dbmmodule.c
2+
===================================================================
3+
--- Modules/dbmmodule.c (revision 84317)
4+
+++ Modules/dbmmodule.c (working copy)
5+
@@ -168,12 +168,18 @@
6+
dbm_contains(register dbmobject *dp, PyObject *v)
7+
{
8+
datum key, val;
9+
+ Py_ssize_t dsize;
10+
11+
- if (PyString_AsStringAndSize(v, (char **)&key.dptr,
12+
- (Py_ssize_t *)&key.dsize)) {
13+
+ if (PyString_AsStringAndSize(v, (char **)&key.dptr, &dsize)) {
14+
return -1;
15+
}
16+
17+
+ /* Coerce from Py_ssize_t down to int: */
18+
+ if (dsize > INT_MAX) {
19+
+ return -1;
20+
+ }
21+
+ key.dsize = dsize;
22+
+
23+
/* Expand check_dbmobject_open to return -1 */
24+
if (dp->di_dbm == NULL) {
25+
PyErr_SetString(DbmError, "DBM object has already been closed");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -up Python-2.7/Lib/test/test_commands.py.gnu-ls-output Python-2.7/Lib/test/test_commands.py
2+
--- Python-2.7/Lib/test/test_commands.py.gnu-ls-output 2010-08-17 11:31:35.714913918 -0400
3+
+++ Python-2.7/Lib/test/test_commands.py 2010-08-17 11:37:08.913911808 -0400
4+
@@ -50,7 +50,7 @@ class CommandTests(unittest.TestCase):
5+
# Note that the first case above has a space in the group name
6+
# while the second one has a space in both names.
7+
pat = r'''d......... # It is a directory.
8+
- \+? # It may have ACLs.
9+
+ [.+@]? # It may have alt access (SELinux, ACLs or metadata ('@' OS X).
10+
\s+\d+ # It has some number of links.
11+
[^/]* # Skip user, group, size, and date.
12+
/\. # and end with the name of the file.

libpython.stp

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Systemtap tapset to make it easier to trace Python */
2+
3+
/*
4+
Define python.function.entry/return:
5+
*/
6+
probe python.function.entry = process("python").library("LIBRARY_PATH").mark("function__entry")
7+
{
8+
filename = user_string($arg1);
9+
funcname = user_string($arg2);
10+
lineno = $arg3;
11+
}
12+
probe python.function.return = process("python").library("LIBRARY_PATH").mark("function__return")
13+
{
14+
filename = user_string($arg1);
15+
funcname = user_string($arg2);
16+
lineno = $arg3;
17+
}

make-pydoc-more-robust-001.patch

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Index: Lib/pydoc.py
2+
===================================================================
3+
--- Lib/pydoc.py (revision 76636)
4+
+++ Lib/pydoc.py (working copy)
5+
@@ -1961,10 +1961,14 @@
6+
if modname[-9:] == '.__init__':
7+
modname = modname[:-9] + ' (package)'
8+
print modname, desc and '- ' + desc
9+
+ def onerror(modname):
10+
+ # Ignore non-ImportError exceptions raised whilst trying to
11+
+ # import modules
12+
+ pass
13+
try: import warnings
14+
except ImportError: pass
15+
else: warnings.filterwarnings('ignore') # ignore problems during import
16+
- ModuleScanner().run(callback, key)
17+
+ ModuleScanner().run(callback, key, onerror=onerror)
18+
19+
# --------------------------------------------------- web browser interface
20+

0 commit comments

Comments
 (0)