Bug 822174 also affects RHEL-5 (5.9 reproduced) # rpm -q sos sos-1.7-9.62.el5 # hostname 'f/t_u-r:!§@#$%^>._ha_*()=+"`;/\?~|}{][hěščÁŤh' # hostname f/t_u-r:!§@#$%^>._ha_*()=+"`;/\?~|}{][hěščÁŤh # sosreport --batch -o general sosreport (version 1.7) This utility will collect some detailed information about the hardware and setup of your Red Hat Enterprise Linux system. The information is collected and an archive is packaged under /tmp, which you can send to a support representative. Red Hat will use this information for diagnostic purposes ONLY and it will be considered confidential information. This process may take a while to complete. No changes will be made to your system. plugin general finished ... Completed. Creating compressed archive... /bin/mv: cannot move `/tmp/sos_QRLfBo' to `/tmp/f/t_u-r:!§@#$%^': No such file or directory sh: gt: command not found sh: -379509: command not found /bin/mv: missing destination file operand after `/tmp/f/t_u-r:!§@#$%^' Try `/bin/mv --help' for more information. sh: gt: command not found sh: -379509: command not found Traceback (most recent call last): File "/usr/sbin/sosreport", line 734, in ? sosreport() File "/usr/sbin/sosreport", line 723, in sosreport policy.packageResults() File "/usr/lib/python2.4/site-packages/sos/policyredhat.py", line 201, in packageResults fp = open(os.path.join(ourtempdir, tarballName), "r") IOError: [Errno 2] No such file or directory: '/tmp/sosreport-f/t_u-r:!\xc2\xa7@#$%^>.tar.bz2'
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