Bug 832855

Summary: Teporary file is left behind with the sed option '--copy'
Product: [Fedora] Fedora Reporter: Mark Wu <wudxw>
Component: sedAssignee: Martin Bříza <mbriza>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: danken, mbriza, pbonzini
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 839292 (view as bug list) Environment:
Last Closed: 2012-08-01 22:27:21 UTC Type: Bug
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: 839292    
Attachments:
Description Flags
Proposed patch to fix the issue
none
Proposed patch to fix the issue (changed function names) none

Description Mark Wu 2012-06-18 01:45:48 UTC
Description of problem:
We found the temporary file is left behind when the sed option '--copy' is used.
This problem happens when vdsm manipulate libvirt's configuration.  Vdsm has to use the option '--copy' since the system call 'rename' is not allowed on bind-mount files (on ovirt node). I can't see the point of remaining the temporary file. My understanding is that with and without '--copy' should be just different ways(truncate+cp vs rename) to change the file in pace. So I think the temporary file should be removed after done.


Version-Release number of selected component (if applicable):
sed-4.2.1-8.fc17

How reproducible:
everytime

Steps to Reproduce:
sed -i --copy -e 's/todo/done/' my_todo_list
then a temporary file like 'sedcMkUCu' was remained after the operation done.

Actual results:


Expected results:
No temporary file is removed after done.

Additional info:

Comment 1 Martin Bříza 2012-06-18 08:38:51 UTC
Hello Mark,

thanks for reporting. I can confirm this bug to be present in Fedora 16. I will have a look at as soon as possible.

Comment 2 Martin Bříza 2012-07-09 12:58:29 UTC
Created attachment 597071 [details]
Proposed patch to fix the issue

This patch should fix the issue when applied to the fedpkg repository. I'll build testing packages for you tomorrow.
There was a problem with the ported patch - it wasn't ported entirely and the ck_fcopy function was left behind.

Comment 3 Martin Bříza 2012-07-10 14:28:42 UTC
Created attachment 597355 [details]
Proposed patch to fix the issue (changed function names)

Hello,
I changed the patch a little bit more to reflect what the functions ck_fcmove and ck_fccopy do. I built a package with this patch on
http://koji.fedoraproject.org/koji/taskinfo?taskID=4230648
so you can test it if you want to.
Thank you.

Comment 4 Mark Wu 2012-07-10 23:31:45 UTC
Martin,

Thanks for the test package. It fixes the problem I reported here.

Comment 5 Fedora Update System 2012-07-18 12:47:08 UTC
sed-4.2.1-9.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/sed-4.2.1-9.fc16

Comment 6 Fedora Update System 2012-07-18 12:58:04 UTC
sed-4.2.1-10.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/sed-4.2.1-10.fc17

Comment 7 Fedora Update System 2012-07-19 08:56:13 UTC
Package sed-4.2.1-10.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing sed-4.2.1-10.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-10756/sed-4.2.1-10.fc17
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-08-01 22:27:21 UTC
sed-4.2.1-10.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.