bugGNU patch - Bugs: bug #29944, patch can delete files in /tmp it...

 
 

bug #29944: patch can delete files in /tmp it does not own

Submitted by:  None
Submitted on:  Sat 22 May 2010 08:58:58 PM UTC  
 
Category: NoneSeverity: 4 - Important
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 17 Sep 2010 11:43:52 AM UTC, comment #1:

The current testing version in ftp://alpha.gnu.org/gnu/patch/ should have this fixed.

Andreas Gruenbacher <agruen>
Project Administrator
Sat 22 May 2010 08:58:58 PM UTC, original submission:

On startup patch used mktemp() to create 4 temporary file names. Later it tries to create those files. If some other process happens to have created one of the files in the meantime, then patch fails:

patch: **** Can't create file /tmp/polB334D : File exists

That is less than ideal -- it should just pick another file name via mktemp(), or just use mkstemp() in the first place to avoid this issue.

Much worse though, is that as patch cleans up and exits, it deletes /tmp/polB334D anyway (access permissions allowing). This can obviously interfere with whatever other program on the system happens to be the real owner of /tmp/polB334D.

In our case, we run several kernel builds in parallel each of which uses patch as part of the build process. Occasionally instances of patch from two different builds clash on a file name and as a result one fails because it can't create the file, and the other fails because the file got removed from under it.

Richard Hirst <richard@sleepie.demon.co.uk>

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by agruen (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 17 Sep 2010 11:43:52 AM UTCagruenStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 25 May 2010 07:48:22 AM UTCagruenSeverity3 - Normal=>4 - Important

    Back to the top


    Powered by Savane 3.1-cleanup1