Bug 445947

Summary: sysreport.legacy reports "Cannot make temp dir"
Product: Red Hat Enterprise Linux 5 Reporter: Bryan Mason <nobody+bjmason>
Component: sosAssignee: Adam Stokes <astokes>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: agk, azelinka, bmr, tao
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 21:42:17 UTC Type: ---
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:    
Bug Blocks: 391501    
Attachments:
Description Flags
Proposed patch
none
Updated patch none

Description Bryan Mason 2008-05-10 06:09:15 UTC
Description of problem:

    Because sysreport.legacy uses $HOME as it's root directory, problems
    can occur if $HOME doesn't exist or isn't writable.

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

    sos-1.7-9.2.el5.noarch

How reproducible:

    Every time, if the home directory doesn't exist.

Steps to Reproduce:

    1. Log into a system using an account that has no local home directory.
    2. Run sysreport.legacy as root using sudo.
  
Actual results:

    $ sudo /usr/sbin/sysreport.legacy
    Password:
    Cannot make temp dir

Expected results:

    Sysreport generated.

Additional info:

    This is actually the same problem reported in Bug 355071, but that report
    was for sysreport and this is reported against sysreport.legacy.

Comment 1 Bryan Mason 2008-05-10 06:11:48 UTC
Created attachment 305002 [details]
Proposed patch

Create a new variable named TEMP='/tmp' and replace occurrences of $HOME with
$TEMP.	I've tested this by renaming /root to /root.saved and running
sysreport.legacy as root from /.

Comment 2 RHEL Program Management 2008-06-02 20:00:44 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 Bryan Mason 2008-10-16 23:14:12 UTC
Some security-related concerns have been raised about the use of /tmp to store the temporary files.  Specifically, see Comment #3 of Bug 320620 (https://bugzilla.redhat.com/show_bug.cgi?id=454690#c3) which is the RHEL 4 version of this Bug.

As soon as we get agreement on the final patch for RHEL 4, I'll post an updated patch here.

Comment 11 Bryan Mason 2008-11-24 20:06:54 UTC
Created attachment 324534 [details]
Updated patch

Don't know if we ever got "agreement" per-se, but nobody complained about the attached patch that was proposed for the RHEL 4 version of this bug.

Comment 13 errata-xmlrpc 2009-01-20 21:42:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0171.html