bugGNU patch - Bugs: bug #53820, Temporary file leaked on failed...

 
 

bug #53820: Temporary file leaked on failed ed-style patch

Submitter:  Jean Delvare <khali>
Submitted:  Thu 03 May 2018 11:52:27 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 07 May 2018 01:16:06 PM UTC, comment #5: 

Pushed as well, thanks.

Andreas Gruenbacher <agruen>
Group administrator
Fri 04 May 2018 08:52:47 AM UTC, comment #4: 

Incremental fix attached, please review/comment.

Jean Delvare <khali>
Fri 04 May 2018 08:33:38 AM UTC, comment #3: 

Unfortunately after more testing I found that my fix is incomplete. If an ed-style patch modifies more than one file, then we still leak a temporary file for all but the last file. I'll look for a better fix.

Jean Delvare <khali>
Thu 03 May 2018 12:34:33 PM UTC, comment #2: 

This looks acceptable.  Applied, thanks.

Andreas Gruenbacher <agruen>
Group administrator
Thu 03 May 2018 12:19:03 PM UTC, comment #1: 

I have attached a candidate fix, please review/comment.

Jean Delvare <khali>
Thu 03 May 2018 11:52:27 AM UTC, original submission:  

If an ed-style patch fails to apply, an unreadable temporary file named pe<something> is leaked. This happens in the test suite itself, so running "make check" triggers the bug:

$ ls /tmp/pe*
ls: cannot access '/tmp/pe*': No such file or directory
$ make check
(...)
PASS: ed-style
(...)
$ ls /tmp/pe*
/tmp/peu3RLvw
$

This temporary file leak was introduced by commit 123eaff0d5d1 ("Fix arbitrary command execution in ed-style patches (CVE-2018-1000156)").

Jean Delvare <khali>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44082:  fix-ed-style-file-leak-multi.patch added by khali (2KiB - text/x-patch - [PATCH] Don't leak temporary file on failed multi-file ed-style patch)
file #44073:  fix-ed-style-file-leak.patch added by khali (3KiB - text/x-patch - [PATCH] Don't leak temporary file on failed ed-style patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by agruen (Posted a comment)
  • -email is unavailable- added by khali (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-04 khali Attached File- Added fix-ed-style-file-leak-multi.patch, #44082
    2018-05-03 agruen StatusNone Fixed
        Open/ClosedOpen Closed
    2018-05-03 khali Attached File- Added fix-ed-style-file-leak.patch, #44073

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code