RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 822174 - hostname handling needs sanity improvement
Summary: hostname handling needs sanity improvement
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sos
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: David Kutálek
URL:
Whiteboard:
Depends On:
Blocks: 976242
TreeView+ depends on / blocked
 
Reported: 2012-05-16 14:38 UTC by David Kutálek
Modified: 2015-11-02 13:58 UTC (History)
4 users (show)

Fixed In Version: sos-2.2-30.el6
Doc Type: Bug Fix
Doc Text:
Cause: Previous versions of sos did not sanitize the system hostname for forbidden characters when using the name in file system paths. Consequence: Inserting path separators and other special characters in the system hostname would cause sos to generate invalid file system paths and fail to generate a report. Fix: Invalid characters are now filtered out of the system hostname. Result: The sosreport command now works correctly on systems having characters disallowed in file system paths present in the hostname.
Clone Of:
: 976242 (view as bug list)
Environment:
Last Closed: 2013-02-21 10:57:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0474 0 normal SHIPPED_LIVE sos bug fix and enhancement update 2013-02-20 21:06:54 UTC

Description David Kutálek 2012-05-16 14:38:59 UTC
Description of problem:

When there is no rhn systemid and --name parameter was not used, hostname is used as a part of sosreport tarball name. sosreport should handle this hostname more carefully to handle wrong hostnames in a sane way. 

# hostname 'f/t_u-r:!§@#$%^>._ha_*()=+"`;/\?~|}{][hěščÁŤďh hh'
# sosreport --batch -o general

sosreport (version 2.2)

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 Enterprise Linux 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.


  Running plugins. Please wait ...

  Completed [1/1] ...      /bin/sh: gt: command not found
/bin/sh: -2012051614411337172088: command not found
/bin/tar: t_u-r\:!§@#$%^: Cannot stat: No such file or directory
/bin/tar: Exiting with failure status due to previous errors
sh: gt: command not found
sh: -2012051614411337172088: command not found

Creating compressed archive...

Your sosreport has been generated and saved in:
  /tmp/f/sosreport-ftu-rgt-20120516144129-e888.tar.xz

The md5sum is: 8dc5aea5b03dff8595f096f9e368e888

Please send this file to your support representative.
---


Version-Release number of selected component (if applicable):

sos-2.2-27.el6.noarch

How reproducible:

Always

Steps to Reproduce:
1. see above
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 RHEL Program Management 2012-07-10 08:46:47 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 2 RHEL Program Management 2012-07-11 01:58:35 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 3 Bryn M. Reeves 2012-10-15 19:12:04 UTC
While I think we're unlikely to come across it very often this is potentially a bit nasty - weird characters in the hostname can cause us to go wandering off around the file system in strange ways.

I've added a filter to the hostname to only accept alphanumeric, dots, dashes and underscores. That's more strict than it really needs to be but leaves less potential for trouble.

Comment 8 errata-xmlrpc 2013-02-21 10:57:25 UTC
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-0474.html


Note You need to log in before you can comment on or make changes to this bug.