Change-Id: I04b3c0edd0fcf80a04b74f5a07d8d3289ed50fa1
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6317
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
| ... | ... |
@@ -31,130 +31,3 @@ index 0837a4a4991e..39ba030b5191 100644 |
| 31 | 31 |
static DWORD (CALLBACK *Py_CreateSymbolicLinkA)(LPSTR, LPSTR, DWORD) = NULL; |
| 32 | 32 |
|
| 33 | 33 |
static int |
| 34 |
-@@ -7259,18 +7259,24 @@ check_CreateSymbolicLink(void) |
|
| 35 |
- return (Py_CreateSymbolicLinkW && Py_CreateSymbolicLinkA); |
|
| 36 |
- } |
|
| 37 |
- |
|
| 38 |
--/* Remove the last portion of the path */ |
|
| 39 |
--static void |
|
| 40 |
-+/* Remove the last portion of the path - return 0 on success */ |
|
| 41 |
-+static int |
|
| 42 |
- _dirnameW(WCHAR *path) |
|
| 43 |
- {
|
|
| 44 |
- WCHAR *ptr; |
|
| 45 |
- |
|
| 46 |
-+ size_t length = wcsnlen_s(path, MAX_PATH); |
|
| 47 |
-+ if (length == MAX_PATH) {
|
|
| 48 |
-+ return -1; |
|
| 49 |
-+ } |
|
| 50 |
- /* walk the path from the end until a backslash is encountered */ |
|
| 51 |
-- for(ptr = path + wcslen(path); ptr != path; ptr--) {
|
|
| 52 |
-- if (*ptr == L'\\' || *ptr == L'/') |
|
| 53 |
-+ for(ptr = path + length; ptr != path; ptr--) {
|
|
| 54 |
-+ if (*ptr == L'\\' || *ptr == L'/'){
|
|
| 55 |
- break; |
|
| 56 |
-+ } |
|
| 57 |
- } |
|
| 58 |
- *ptr = 0; |
|
| 59 |
-+ return 0; |
|
| 60 |
- } |
|
| 61 |
- |
|
| 62 |
- /* Remove the last portion of the path */ |
|
| 63 |
-@@ -7299,29 +7305,26 @@ _is_absW(const WCHAR *path) |
|
| 64 |
- static int |
|
| 65 |
- _is_absA(const char *path) |
|
| 66 |
- {
|
|
| 67 |
-- return path[0] == '\\' || path[0] == '/' || path[1] == ':'; |
|
| 68 |
-- |
|
| 69 |
-+ return path[0] == L'\\' || path[0] == L'/' || |
|
| 70 |
-+ (path[0] && path[1] == L':'); |
|
| 71 |
- } |
|
| 72 |
- |
|
| 73 |
--/* join root and rest with a backslash */ |
|
| 74 |
--static void |
|
| 75 |
-+/* join root and rest with a backslash - return 0 on success */ |
|
| 76 |
-+static int |
|
| 77 |
- _joinW(WCHAR *dest_path, const WCHAR *root, const WCHAR *rest) |
|
| 78 |
- {
|
|
| 79 |
-- size_t root_len; |
|
| 80 |
-- |
|
| 81 |
- if (_is_absW(rest)) {
|
|
| 82 |
-- wcscpy(dest_path, rest); |
|
| 83 |
-- return; |
|
| 84 |
-+ return wcscpy_s(dest_path, MAX_PATH, rest); |
|
| 85 |
- } |
|
| 86 |
- |
|
| 87 |
-- root_len = wcslen(root); |
|
| 88 |
-- |
|
| 89 |
-- wcscpy(dest_path, root); |
|
| 90 |
-- if(root_len) {
|
|
| 91 |
-- dest_path[root_len] = L'\\'; |
|
| 92 |
-- root_len++; |
|
| 93 |
-+ if (wcscpy_s(dest_path, MAX_PATH, root)) {
|
|
| 94 |
-+ return -1; |
|
| 95 |
- } |
|
| 96 |
-- wcscpy(dest_path+root_len, rest); |
|
| 97 |
-+ |
|
| 98 |
-+ if (dest_path[0] && wcscat_s(dest_path, MAX_PATH, L"\\")) {
|
|
| 99 |
-+ return -1; |
|
| 100 |
-+ } |
|
| 101 |
-+ return wcscat_s(dest_path, MAX_PATH, rest); |
|
| 102 |
- } |
|
| 103 |
- |
|
| 104 |
- /* join root and rest with a backslash */ |
|
| 105 |
-@@ -7354,10 +7357,14 @@ _check_dirW(WCHAR *src, WCHAR *dest) |
|
| 106 |
- WCHAR src_resolved[MAX_PATH] = L""; |
|
| 107 |
- |
|
| 108 |
- /* dest_parent = os.path.dirname(dest) */ |
|
| 109 |
-- wcscpy(dest_parent, dest); |
|
| 110 |
-- _dirnameW(dest_parent); |
|
| 111 |
-+ if (wcscpy_s(dest_parent, MAX_PATH, dest) || |
|
| 112 |
-+ _dirnameW(dest_parent)) {
|
|
| 113 |
-+ return 0; |
|
| 114 |
-+ } |
|
| 115 |
- /* src_resolved = os.path.join(dest_parent, src) */ |
|
| 116 |
-- _joinW(src_resolved, dest_parent, src); |
|
| 117 |
-+ if (_joinW(src_resolved, dest_parent, src)) {
|
|
| 118 |
-+ return 0; |
|
| 119 |
-+ } |
|
| 120 |
- return ( |
|
| 121 |
- GetFileAttributesExW(src_resolved, GetFileExInfoStandard, &src_info) |
|
| 122 |
- && src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY |
|
| 123 |
-@@ -7432,15 +7439,10 @@ os_symlink_impl(PyObject *module, path_t *src, path_t *dst, |
|
| 124 |
- } |
|
| 125 |
- #endif |
|
| 126 |
- |
|
| 127 |
-- if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
|
|
| 128 |
-- PyErr_SetString(PyExc_ValueError, |
|
| 129 |
-- "symlink: src and dst must be the same type"); |
|
| 130 |
-- return NULL; |
|
| 131 |
-- } |
|
| 132 |
- |
|
| 133 |
- #ifdef MS_WINDOWS |
|
| 134 |
- |
|
| 135 |
-- Py_BEGIN_ALLOW_THREADS |
|
| 136 |
-+ _Py_BEGIN_SUPPRESS_IPH |
|
| 137 |
- if (dst->wide) {
|
|
| 138 |
- /* if src is a directory, ensure target_is_directory==1 */ |
|
| 139 |
- target_is_directory |= _check_dirW(src->wide, dst->wide); |
|
| 140 |
-@@ -7453,13 +7455,19 @@ os_symlink_impl(PyObject *module, path_t *src, path_t *dst, |
|
| 141 |
- result = Py_CreateSymbolicLinkA(dst->narrow, src->narrow, |
|
| 142 |
- target_is_directory); |
|
| 143 |
- } |
|
| 144 |
-- Py_END_ALLOW_THREADS |
|
| 145 |
-+ _Py_END_SUPPRESS_IPH |
|
| 146 |
- |
|
| 147 |
- if (!result) |
|
| 148 |
- return path_error2(src, dst); |
|
| 149 |
- |
|
| 150 |
- #else |
|
| 151 |
- |
|
| 152 |
-+ if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
|
|
| 153 |
-+ PyErr_SetString(PyExc_ValueError, |
|
| 154 |
-+ "symlink: src and dst must be the same type"); |
|
| 155 |
-+ return NULL; |
|
| 156 |
-+ } |
|
| 157 |
-+ |
|
| 158 |
- Py_BEGIN_ALLOW_THREADS |
|
| 159 |
- #if HAVE_SYMLINKAT |
|
| 160 |
- if (dir_fd != DEFAULT_DIR_FD) |
| ... | ... |
@@ -44,108 +44,6 @@ Co-authored-by: Christian Heimes <christian@python.org>. |
| 44 | 44 |
6 files changed, 39 insertions(+), 4 deletions(-) |
| 45 | 45 |
create mode 100644 Misc/NEWS.d/next/Security/2018-03-02-10-24-52.bpo-32981.O_qDyj.rst |
| 46 | 46 |
|
| 47 |
-diff --git a/Lib/difflib.py b/Lib/difflib.py |
|
| 48 |
-index 076bbac01dee..b4ec33505644 100644 |
|
| 49 |
-+++ b/Lib/difflib.py |
|
| 50 |
-@@ -1083,7 +1083,7 @@ def _qformat(self, aline, bline, atags, btags): |
|
| 51 |
- |
|
| 52 |
- import re |
|
| 53 |
- |
|
| 54 |
--def IS_LINE_JUNK(line, pat=re.compile(r"\s*#?\s*$").match): |
|
| 55 |
-+def IS_LINE_JUNK(line, pat=re.compile(r"\s*(?:#\s*)?$").match): |
|
| 56 |
- r""" |
|
| 57 |
- Return 1 for ignorable line: iff `line` is blank or contains a single '#'. |
|
| 58 |
- |
|
| 59 |
-diff --git a/Lib/poplib.py b/Lib/poplib.py |
|
| 60 |
-index 516b6f060d28..2437ea0e2717 100644 |
|
| 61 |
-+++ b/Lib/poplib.py |
|
| 62 |
-@@ -308,7 +308,7 @@ def rpop(self, user): |
|
| 63 |
- return self._shortcmd('RPOP %s' % user)
|
|
| 64 |
- |
|
| 65 |
- |
|
| 66 |
-- timestamp = re.compile(br'\+OK.*(<[^>]+>)') |
|
| 67 |
-+ timestamp = re.compile(br'\+OK.[^<]*(<.*>)') |
|
| 68 |
- |
|
| 69 |
- def apop(self, user, password): |
|
| 70 |
- """Authorisation |
|
| 71 |
-diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py |
|
| 72 |
-index ab9debf8e252..b6c8a7dd5bed 100644 |
|
| 73 |
-+++ b/Lib/test/test_difflib.py |
|
| 74 |
-@@ -466,13 +466,33 @@ def _assert_type_error(self, msg, generator, *args): |
|
| 75 |
- list(generator(*args)) |
|
| 76 |
- self.assertEqual(msg, str(ctx.exception)) |
|
| 77 |
- |
|
| 78 |
-+class TestJunkAPIs(unittest.TestCase): |
|
| 79 |
-+ def test_is_line_junk_true(self): |
|
| 80 |
-+ for line in ['#', ' ', ' #', '# ', ' # ', '']: |
|
| 81 |
-+ self.assertTrue(difflib.IS_LINE_JUNK(line), repr(line)) |
|
| 82 |
-+ |
|
| 83 |
-+ def test_is_line_junk_false(self): |
|
| 84 |
-+ for line in ['##', ' ##', '## ', 'abc ', 'abc #', 'Mr. Moose is up!']: |
|
| 85 |
-+ self.assertFalse(difflib.IS_LINE_JUNK(line), repr(line)) |
|
| 86 |
-+ |
|
| 87 |
-+ def test_is_line_junk_REDOS(self): |
|
| 88 |
-+ evil_input = ('\t' * 1000000) + '##'
|
|
| 89 |
-+ self.assertFalse(difflib.IS_LINE_JUNK(evil_input)) |
|
| 90 |
-+ |
|
| 91 |
-+ def test_is_character_junk_true(self): |
|
| 92 |
-+ for char in [' ', '\t']: |
|
| 93 |
-+ self.assertTrue(difflib.IS_CHARACTER_JUNK(char), repr(char)) |
|
| 94 |
-+ |
|
| 95 |
-+ def test_is_character_junk_false(self): |
|
| 96 |
-+ for char in ['a', '#', '\n', '\f', '\r', '\v']: |
|
| 97 |
-+ self.assertFalse(difflib.IS_CHARACTER_JUNK(char), repr(char)) |
|
| 98 |
- |
|
| 99 |
- def test_main(): |
|
| 100 |
- difflib.HtmlDiff._default_prefix = 0 |
|
| 101 |
- Doctests = doctest.DocTestSuite(difflib) |
|
| 102 |
- run_unittest( |
|
| 103 |
- TestWithAscii, TestAutojunk, TestSFpatches, TestSFbugs, |
|
| 104 |
-- TestOutputFormat, TestBytes, Doctests) |
|
| 105 |
-+ TestOutputFormat, TestBytes, TestJunkAPIs, Doctests) |
|
| 106 |
- |
|
| 107 |
- if __name__ == '__main__': |
|
| 108 |
- test_main() |
|
| 109 |
-diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py |
|
| 110 |
-index bceeb93ad14a..799e40365214 100644 |
|
| 111 |
-+++ b/Lib/test/test_poplib.py |
|
| 112 |
-@@ -300,9 +300,19 @@ def test_noop(self): |
|
| 113 |
- def test_rpop(self): |
|
| 114 |
- self.assertOK(self.client.rpop('foo'))
|
|
| 115 |
- |
|
| 116 |
-- def test_apop(self): |
|
| 117 |
-+ def test_apop_normal(self): |
|
| 118 |
- self.assertOK(self.client.apop('foo', 'dummypassword'))
|
|
| 119 |
- |
|
| 120 |
-+ def test_apop_REDOS(self): |
|
| 121 |
-+ # Replace welcome with very long evil welcome. |
|
| 122 |
-+ # NB The upper bound on welcome length is currently 2048. |
|
| 123 |
-+ # At this length, evil input makes each apop call take |
|
| 124 |
-+ # on the order of milliseconds instead of microseconds. |
|
| 125 |
-+ evil_welcome = b'+OK' + (b'<' * 1000000) |
|
| 126 |
-+ with test_support.swap_attr(self.client, 'welcome', evil_welcome): |
|
| 127 |
-+ # The evil welcome is invalid, so apop should throw. |
|
| 128 |
-+ self.assertRaises(poplib.error_proto, self.client.apop, 'a', 'kb') |
|
| 129 |
-+ |
|
| 130 |
- def test_top(self): |
|
| 131 |
- expected = (b'+OK 116 bytes', |
|
| 132 |
- [b'From: postmaster@python.org', b'Content-Type: text/plain', |
|
| 133 |
-diff --git a/Misc/ACKS b/Misc/ACKS |
|
| 134 |
-index 1a35aad66ce7..72c5d740bdd2 100644 |
|
| 135 |
-+++ b/Misc/ACKS |
|
| 136 |
-@@ -341,6 +341,7 @@ Kushal Das |
|
| 137 |
- Jonathan Dasteel |
|
| 138 |
- Pierre-Yves David |
|
| 139 |
- A. Jesse Jiryu Davis |
|
| 140 |
-+Jamie (James C.) Davis |
|
| 141 |
- Merlijn van Deen |
|
| 142 |
- John DeGood |
|
| 143 |
- Ned Deily |
|
| 144 | 47 |
diff --git a/Misc/NEWS.d/next/Security/2018-03-02-10-24-52.bpo-32981.O_qDyj.rst b/Misc/NEWS.d/next/Security/2018-03-02-10-24-52.bpo-32981.O_qDyj.rst |
| 145 | 48 |
new file mode 100644 |
| 146 | 49 |
index 000000000000..9ebabb44f91e |
| ... | ... |
@@ -1,14 +1,14 @@ |
| 1 | 1 |
Summary: A high-level scripting language |
| 2 | 2 |
Name: python3 |
| 3 |
-Version: 3.5.5 |
|
| 4 |
-Release: 2%{?dist}
|
|
| 3 |
+Version: 3.5.6 |
|
| 4 |
+Release: 1%{?dist}
|
|
| 5 | 5 |
License: PSF |
| 6 | 6 |
URL: http://www.python.org/ |
| 7 | 7 |
Group: System Environment/Programming |
| 8 | 8 |
Vendor: VMware, Inc. |
| 9 | 9 |
Distribution: Photon |
| 10 | 10 |
Source0: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
|
| 11 |
-%define sha1 Python=66c4cfc0f64b545ee5a7725f26a2fd834cdf1682 |
|
| 11 |
+%define sha1 Python=05548da58ec75a7af316c4a4cb8fc667ac6ac8f9 |
|
| 12 | 12 |
Patch0: cgi3.patch |
| 13 | 13 |
Patch1: sockWarning.patch |
| 14 | 14 |
Patch3: python3-CVE-2018-1000117.patch |
| ... | ... |
@@ -199,6 +199,8 @@ rm -rf %{buildroot}/*
|
| 199 | 199 |
%{_bindir}/idle*
|
| 200 | 200 |
|
| 201 | 201 |
%changelog |
| 202 |
+* Thu Dec 06 2018 Sujay G <gsujay@vmware.com> 3.5.6-1 |
|
| 203 |
+- Upgrade to version 3.5.6 |
|
| 202 | 204 |
* Fri Aug 17 2018 Dweep Advani <dadvani@vmware.com> 3.5.5-2 |
| 203 | 205 |
- Fix CVE-2018-1060 and CVE-2018-1061 |
| 204 | 206 |
* Fri May 11 2018 Xiaolin Li <xiaolinl@vmware.com> 3.5.5-1 |
| ... | ... |
@@ -210,7 +212,7 @@ rm -rf %{buildroot}/*
|
| 210 | 210 |
* Tue Sep 26 2017 Anish Swaminathan <anishs@vmware.com> 3.5.3-7 |
| 211 | 211 |
- Release bump for expat version update |
| 212 | 212 |
* Thu Sep 14 2017 Kumar Kaushik <kaushikk@vmware.com> 3.5.3-6 |
| 213 |
-- Adding patch for socket cleanup issue, Bug # 1956257. |
|
| 213 |
+- Adding patch for socket cleanup issue, Bug # 1956257. |
|
| 214 | 214 |
* Fri Jul 28 2017 Divya Thaluru <dthaluru@vmware.com> 3.5.3-5 |
| 215 | 215 |
- Fixed dependencies for easy_install-3.5 |
| 216 | 216 |
* Thu Jun 29 2017 Divya Thaluru <dthaluru@vmware.com> 3.5.3-4 |