Note - The fix for https://bugs.launchpad.net/ubuntu/+source/sosreport/+bug/2024547 has been built on top of 4.5.4 upstream for this release. The patch is named d/p/0002-regex-flags.patch, pasted below for reference,
Description: Fix do_file_private_sub() bug related to regex flags Origin: upstream Bug: https://github.com/sosreport/sos/issues/3261 Applied-Upstream: https://github.com/sosreport/sos/pull/3263 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: sos-4.5.4/sos/report/plugins/__init__.py =================================================================== --- sos-4.5.4.orig/sos/report/plugins/__init__.py +++ sos-4.5.4/sos/report/plugins/__init__.py @@ -1274,7 +1274,12 @@ class Plugin(): """ try: path = self._get_dest_for_srcpath(srcpath) - pattern = regexp.pattern if hasattr(regexp, "pattern") else regexp + if hasattr(regexp, "pattern"): + pattern = regexp.pattern + flags = regexp.flags | re.IGNORECASE + else: + pattern = regexp + flags = re.IGNORECASE self._log_debug("substituting scrpath '%s'" % srcpath) self._log_debug("substituting '%s' for '%s' in '%s'" % (subst, pattern, path)) @@ -1284,8 +1289,8 @@ class Plugin(): content = readable.read() if not isinstance(content, str): content = content.decode('utf8', 'ignore') - result, replacements = re.subn(regexp, subst, content, - flags=re.IGNORECASE) + result, replacements = re.subn(pattern, subst, content, + flags=flags) if replacements: self.archive.add_string(result, srcpath) else:
Note - The fix for https:/ /bugs.launchpad .net/ubuntu/ +source/ sosreport/ +bug/2024547 has been built on top of 4.5.4 upstream for this release. The patch is named d/p/0002- regex-flags. patch, pasted below for reference,
Description: Fix do_file_ private_ sub() bug related to regex flags /github. com/sosreport/ sos/issues/ 3261 /github. com/sosreport/ sos/pull/ 3263 dep.debian. net/deps/ dep3/ 4/sos/report/ plugins/ __init_ _.py ======= ======= ======= ======= ======= ======= ======= ======= ==== 4.orig/ sos/report/ plugins/ __init_ _.py 4/sos/report/ plugins/ __init_ _.py dest_for_ srcpath( srcpath)
self. _log_debug( "substituting scrpath '%s'" % srcpath)
self. _log_debug( "substituting '%s' for '%s' in '%s'"
% (subst, pattern, path))
content = readable.read()
content = content. decode( 'utf8', 'ignore') IGNORECASE)
self. archive. add_string( result, srcpath)
Origin: upstream
Bug: https:/
Applied-Upstream: https:/
---
This patch header follows DEP-3: http://
Index: sos-4.5.
=======
--- sos-4.5.
+++ sos-4.5.
@@ -1274,7 +1274,12 @@ class Plugin():
"""
try:
path = self._get_
- pattern = regexp.pattern if hasattr(regexp, "pattern") else regexp
+ if hasattr(regexp, "pattern"):
+ pattern = regexp.pattern
+ flags = regexp.flags | re.IGNORECASE
+ else:
+ pattern = regexp
+ flags = re.IGNORECASE
@@ -1284,8 +1289,8 @@ class Plugin():
if not isinstance(content, str):
- result, replacements = re.subn(regexp, subst, content,
- flags=re.
+ result, replacements = re.subn(pattern, subst, content,
+ flags=flags)
if replacements:
else: