Bug 122958

Summary: fixfiles relabel stomps on log file in /tmp
Product: [Fedora] Fedora Reporter: Tom Mitchell <mitch48>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: pgraner
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-10 19:20:38 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:

Description Tom Mitchell 2004-05-10 18:29:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Description of problem:
fixfiles relabel stomps on log file in /tmp

# fixfiles relabel
logging to /tmp/fixfiles.fKyAqa3977
Cleaning out /tmp

In the case of relabel /tmp is cleaned out
after "mktemp /tmp/fixfiles.XXXXXXXXXX"

It is recreated later with " ... |tee $LOGFILE"
with a less correct umask and there is a small window
where the log file could be opened by another user
and the log trashed or strange content included.

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

How reproducible:
Always

Steps to Reproduce:
1. /sbin/fixfiles relabel

2. inspect the output
  # fixfiles relabel
  logging to /tmp/fixfiles.fKyAqa3977
  Cleaning out /tmp

3. note the order of events...
   strace -f will show the unlink and recreation with a new umask.

    

Additional info:

More bad style than anything at this point since
'tee' exposes the content in real time.

Comment 1 Daniel Walsh 2004-05-10 19:27:07 UTC
Moved log file to /var/tmp/

Fixed in policycoreutils-1.11-4

Dan