Bug 976242
| Summary: | hostname handling needs sanity improvement | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Miroslav Hradílek <mhradile> |
| Component: | sos | Assignee: | Bryn M. Reeves <bmr> |
| Status: | CLOSED ERRATA | QA Contact: | Miroslav Hradílek <mhradile> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | 5.9 | CC: | agk, bmr, dkutalek, gavin, lmiksik, mhradile, prc |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | sos-1.7-9.65.el5 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 822174 | Environment: | |
| Last Closed: | 2013-10-01 00:37:30 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 822174 | ||
| Bug Blocks: | |||
|
Comment 1
Miroslav Hradílek
2013-06-20 08:03:41 UTC
Also related to this bug 771393. Was sosreport in RHEL-5 ever capable of using info from /etc/sysconfig/rhn/systemid ? On sos-1.7-9.62.el5 it seems to ignore it entirely and use hostname instead. On the same package, the sanitization seems to be in place although not consistent with RHEL-6. When crippled username (containing weird characters) is given using --name parameter it only outputs alphanumeric characters (no '-' dashes) unlike in RHEL-6. This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release. This change brings hostname handling in line with rhel6:
- Strip all non-alphanumeric/dash characters
- If string is empty substitute 'default' (date/time will make unique)
# gendiff sos .orig
diff -up sos/policyredhat.py.orig sos/policyredhat.py
--- sos/policyredhat.py.orig 2013-07-23 17:13:46.000000000 +0100
+++ sos/policyredhat.py 2013-07-23 17:13:51.000000000 +0100
@@ -152,6 +152,7 @@ class SosPolicy:
sys.exit(0)
if len(self.reportName) == 0:
+ localname = re.sub(r"[^_a-zA-Z.0-9-]", "", localname)
self.reportName = localname
if self.cInfo['cmdlineopts'].customerName:
@@ -162,6 +163,9 @@ class SosPolicy:
self.ticketNumber = self.cInfo['cmdlineopts'].ticketNumber
self.ticketNumber = re.sub(r"[^0-9]", "", self.ticketNumber)
+ if len(self.reportName) == 0:
+ self.reportName = "default"
+
return
def packageResults(self):
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1356.html |