SHA256
1
0
forked from pool/cloud-init
Richard Brown 2021-08-16 08:08:31 +00:00 committed by Git OBS Bridge
commit 6b19333bfc
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,19 @@
--- a/cloudinit/distros/tests/test_init.py
+++ b/cloudinit/distros/tests/test_init.py
@@ -11,10 +11,15 @@ import pytest
from cloudinit.distros import _get_package_mirror_info, LDH_ASCII_CHARS
+# In newer versions of Python, these characters will be omitted instead
+# of substituted because of security concerns.
+# See https://bugs.python.org/issue43882
+SECURITY_URL_CHARS = '\n\r\t'
# Define a set of characters we would expect to be replaced
INVALID_URL_CHARS = [
- chr(x) for x in range(127) if chr(x) not in LDH_ASCII_CHARS
+ chr(x) for x in range(127)
+ if chr(x) not in LDH_ASCII_CHARS + SECURITY_URL_CHARS
]
for separator in [":", ".", "/", "#", "?", "@", "[", "]"]:
# Remove from the set characters that either separate hostname parts (":",

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Aug 12 02:16:08 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
- Add cloud-init-update-test-characters-in-substitution-unit-test.patch
to fix unit test fail in TestGetPackageMirrorInfo::test_substitution.
-------------------------------------------------------------------
Fri Jul 9 10:45:23 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -52,6 +52,8 @@ Patch73: cloud-init-no-pwd-in-log.patch
Patch74: cloud-init-purge-cache-py-ver-change.patch
# PATCH-FIX-UPSTREAM https://github.com/canonical/cloud-init/commit/f23a4c4262ac11cd75c99fcbfbfe453f4e115f18
Patch75: 0001-templater-drop-Jinja-Python-2-compatibility-shim.patch
# PATCH-FIX-UPSTREAM https://github.com/canonical/cloud-init/commit/899bfaa9d6bfab1db0df99257628ca1f6febff60
Patch76: cloud-init-update-test-characters-in-substitution-unit-test.patch
BuildRequires: fdupes
BuildRequires: filesystem
# pkg-config is needed to find correct systemd unit dir
@ -161,6 +163,7 @@ Documentation and examples for cloud-init tools
%if 0%{?suse_version} >= 1550
%patch75 -p1
%endif
%patch76 -p1
# patch in the full version to version.py
version_pys=$(find . -name version.py -type f)
[ -n "$version_pys" ] ||