Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/68820.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Patch the vendored tornado version to account for CVE patches that have been applied.
7 changes: 5 additions & 2 deletions salt/ext/tornado/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
# is zero for an official release, positive for a development branch,
# or negative for a release candidate or beta (after the base version
# number has been incremented)
version = "4.5.3"
version_info = (4, 5, 3, 0)


# The bundled version is 4.5.3 and has been patched for CVEs up to 6.5.5
version = "6.5.5"
version_info = (6, 5, 5, 0)
4 changes: 1 addition & 3 deletions salt/transport/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,7 @@ def _create_stream(
stream = salt.ext.tornado.iostream.IOStream(
sock, max_buffer_size=max_buffer_size
)
if salt.ext.tornado.version_info < (5,):
return stream.connect(addr)
return stream, stream.connect(addr)
return stream.connect(addr)


# TODO consolidate with IPCClient
Expand Down
27 changes: 25 additions & 2 deletions tests/integration/modules/test_gem.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setUp(self):
self.GEM_VER = "1.1.2"
self.OLD_GEM = "brass"
self.OLD_VERSION = "1.0.0"
self.NEW_VERSION = "1.2.1"
self.NEW_VERSION = "1.3.0"
self.GEM_LIST = [self.GEM, self.OLD_GEM]
for name in (
"GEM",
Expand All @@ -56,6 +56,15 @@ def uninstall_gem():

self.addCleanup(uninstall_gem)

def uninstall_old_gem():
if self.run_function("gem.list", [self.OLD_GEM]):
self.run_function("gem.uninstall", [self.OLD_GEM])

# Ensure OLD_GEM is not installed before the test (handles leftover state
# from a previously failed run that skipped its own cleanup).
uninstall_old_gem()
self.addCleanup(uninstall_old_gem)

def run_function(self, function, *args, **kwargs):
"""Override run_function to use the gem binary"""
kwargs["gem_bin"] = self.GEM_BIN
Expand Down Expand Up @@ -143,7 +152,21 @@ def test_update(self):

self.run_function("gem.update", [self.OLD_GEM])
gem_list = self.run_function("gem.list", [self.OLD_GEM])
self.assertEqual({self.OLD_GEM: [self.NEW_VERSION, self.OLD_VERSION]}, gem_list)
installed_versions = gem_list.get(self.OLD_GEM, [])

if installed_versions == [self.OLD_VERSION]:
# gem update may be unable to install a newer version when the
# only available release requires a Ruby version not present on
# this system (e.g. brass >= 1.3.0 requires Ruby >= 3.1).
self.skipTest(
"gem update did not install a newer version of {}; the "
"latest release may require a newer Ruby version".format(self.OLD_GEM)
)

self.assertEqual(
{self.OLD_GEM: [self.NEW_VERSION, self.OLD_VERSION]},
gem_list,
)

self.run_function("gem.uninstall", [self.OLD_GEM])
self.assertFalse(self.run_function("gem.list", [self.OLD_GEM]))
Expand Down
Loading