Hide Forgot
Description of problem: when rhn user name contains character '/' in it, Sosreport is giving following error /bin/sh: /tmp/sosreport-ABCD/XYZ-20111230154705.tar.xz: No such file or directory /bin/tar: -: Cannot write: Broken pipe /bin/tar: Error is not recoverable: exiting now Traceback (most recent call last): File "/usr/sbin/sosreport", line 23, in <module> sosreport(sys.argv[1:]) File "/usr/lib/python2.6/site-packages/sos/sosreport.py", line 843, in sosreport GlobalVars.policy.displayResults() File "/usr/lib/python2.6/site-packages/sos/policyredhat.py", line 329, in displayResults fp = open(self.report_file, "r") IOError: [Errno 2] No such file or directory: '/tmp/sosreport-ABCD/XYZ-20111230154705.tar.xz' Version-Release number of selected component (if applicable): sos-2.2-17 How reproducible: Always Steps to Reproduce: 1. Open /etc/sysconfig/rhn/systemid 2. Edit value of field 'username'. Add '/' character in username. e.g. <name>username</name> <value><string>abc/xyz</string></value> 3. Run command # sosreport Actual results: Sosreport is giving following error /bin/sh: /tmp/sosreport-ABCD/XYZ-20111230154705.tar.xz: No such file or directory /bin/tar: -: Cannot write: Broken pipe /bin/tar: Error is not recoverable: exiting now Traceback (most recent call last): File "/usr/sbin/sosreport", line 23, in <module> sosreport(sys.argv[1:]) File "/usr/lib/python2.6/site-packages/sos/sosreport.py", line 843, in sosreport GlobalVars.policy.displayResults() File "/usr/lib/python2.6/site-packages/sos/policyredhat.py", line 329, in displayResults fp = open(self.report_file, "r") IOError: [Errno 2] No such file or directory: '/tmp/sosreport-ABCD/XYZ-20111230154705.tar.xz' Expected results: Sosreport should trim down character '/' from rhn username and continue.. Additional info: Trivial patch to file - /usr/lib/python2.6/site-packages/sos/policyredhat.py --- policyredhat.py.bkup 2012-01-03 21:18:23.223920912 +0530 +++ policyredhat.py 2012-01-03 21:06:52.627932715 +0530 @@ -246,6 +246,7 @@ else: self.reportName = self.reportName + self.reportName = self.reportName.replace('/','') curwd = os.getcwd() os.chdir(os.path.dirname(self.cInfo['dstroot'])) oldmask = os.umask(077)
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: * Previous releases of sos used inconsistent input sanitization rules depending on whether user name and case information was supplied interactively or read from system configuration files * This caused sos to fail to properly sanitize certain invalid strings when read from configuration files and to apply different sanitization to the same strings when input interactively * All name and number sanitization is now carried out in a single location and all input routines have been modified to use these routines * Name and number sanitization rules are now applied consistently regardless of the source of the data
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/RHSA-2012-0958.html