[sru] bug in do_file_private_sub for the juju plugin
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
sosreport (Ubuntu) | Status tracked in Mantic | |||||
Focal |
Fix Committed
|
Medium
|
nikhil kshirsagar | |||
Jammy |
Fix Committed
|
Medium
|
nikhil kshirsagar | |||
Kinetic |
Won't Fix
|
Medium
|
nikhil kshirsagar | |||
Lunar |
Fix Committed
|
Medium
|
nikhil kshirsagar | |||
Mantic |
Fix Released
|
Medium
|
nikhil kshirsagar |
Bug Description
[IMPACT]
As described in https:/
Traceback (most recent call last):
File "/usr/lib/
plug.postproc()
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
result, replacements = re.subn(regexp, subst, content,
File "/usr/lib/
return _compile(pattern, flags).subn(repl, string, count)
File "/usr/lib/
raise ValueError(
ValueError: cannot process flags argument with a compiled pattern
The issue was introduced by this commit - https:/
It is fixed by https:/
The patch is taken for the 4.5.4 sos release in https:/
Description: Fix do_file_
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
self.
self.
@@ -1284,8 +1289,8 @@ class Plugin():
content = readable.read()
if not isinstance(content, str):
content = content.
- result, replacements = re.subn(regexp, subst, content,
- flags=re.
+ result, replacements = re.subn(pattern, subst, content,
+ flags=flags)
if replacements:
self.
else:
[TEST PLAN]
The 4.5.4 ppa's built with this additional fix are tested as per the process described https:/
[WHERE PROBLEMS COULD OCCUR]
As this bug is in a method invoked by multiple plugins, verification also would need to performed in environments that ensures those plugins are enabled, particularly on other distributions. In our testing, we have found no issues, but there might be some disabled plugins that use that method with assumptions that are made invalid by the patch. However we have found no evidence so far of such occurences.
Changed in sosreport (Ubuntu Mantic): | |
status: | Fix Committed → Fix Released |
importance: | Undecided → Medium |
Changed in sosreport (Ubuntu Lunar): | |
importance: | Undecided → Medium |
Changed in sosreport (Ubuntu Kinetic): | |
importance: | Undecided → Medium |
Changed in sosreport (Ubuntu Jammy): | |
importance: | Undecided → Medium |
Changed in sosreport (Ubuntu Focal): | |
importance: | Undecided → Medium |
assignee: | nobody → nikhil kshirsagar (nkshirsagar) |
Changed in sosreport (Ubuntu Jammy): | |
assignee: | nobody → nikhil kshirsagar (nkshirsagar) |
Changed in sosreport (Ubuntu Kinetic): | |
assignee: | nobody → nikhil kshirsagar (nkshirsagar) |
Changed in sosreport (Ubuntu Lunar): | |
assignee: | nobody → nikhil kshirsagar (nkshirsagar) |
Changed in sosreport (Ubuntu Mantic): | |
assignee: | nobody → nikhil kshirsagar (nkshirsagar) |
summary: |
- bug in do_file_private_sub for the juju plugin + [sru] bug in do_file_private_sub for the juju plugin |
description: | updated |
description: | updated |
Fixed upstream, and also built on top of the upstraem 4.5.4 sos release for ubuntu 4.5.4 release - https:/ /bugs.launchpad .net/ubuntu/ +source/ sosreport/ +bug/2022915