Bug 883002

Summary: curl used with file:// protocol opens and closes a destination file twice
Product: Red Hat Enterprise Linux 6 Reporter: Jakub Filak <jfilak>
Component: curlAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Stefan Kremen <skremen>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4CC: jberan, kdudka, ovasik, paul
Target Milestone: rcKeywords: EasyFix
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: curl-7.19.7-43.el6 Doc Type: Bug Fix
Doc Text:
Due to suboptimal implementation of the FILE protocol in libcurl, a single upload transfer opened the destination file twice. The unnecessary open operation produced a noisy event if the destination file was monitored by the inotify kernel subsystem. Therefore, the implementation of the FILE protocol in libcurl has been changed to open the destination file only once per upload. With the updated packages, no such noisy events are produced any more.
Story Points: ---
Clone Of: 844385 Environment:
Last Closed: 2015-07-22 05:42:52 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:
Bug Depends On: 844385    
Bug Blocks:    

Description Jakub Filak 2012-12-03 15:40:02 UTC
+++ This bug was initially created as a clone of Bug #844385 +++

Description of problem:
file_upload() function opens and closes the destination file twice. It causes two occurences of IN_CLOSE_WRITE inotify event.

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

How reproducible:

Steps to Reproduce:
1. curl file:///tmp/testfile -T /etc/hosts
Actual results:
curl opens and closes the destination file twice

Expected results:
curl opens and closes destination file only once

Additional info:
source: lib/file.c line: 354

--- Additional comment from Kamil Dudka on 2012-07-30 15:06:41 CEST ---

upstream commit:


--- Additional comment from Kamil Dudka on 2012-08-01 10:36:23 CEST ---

fixed in curl-7.27.0-2.fc18

--- Additional comment from Fedora Update System on 2012-08-01 11:32:32 CEST ---

curl-7.24.0-5.fc17 has been submitted as an update for Fedora 17.

--- Additional comment from Fedora Update System on 2012-08-02 00:26:24 CEST ---

Package curl-7.24.0-5.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 curl-7.24.0-5.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

--- Additional comment from Fedora Update System on 2012-08-10 01:26:22 CEST ---

curl-7.24.0-5.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 1 Jakub Filak 2012-12-03 17:24:19 UTC
ABRT uses inotify events to get notify about uploaded problem archives. When inotify event is received, ABRT unpacks an uploaded archive in the dump dir location and abrt-server starts its processing. The second inotify event causes that ABRT unpacks the uploaded archive again and abrt-server starts its processing again. Apart from wasting of disk space and cpu, double processing of a single problem leads to removal of all concurrently processed problems. Hence the second inotify event leads to loss of an uploaded archive. ABRT cannot keep  list of processed archives because users can upload archives with a single name again. An enhancement of ABRT's architecture which can make ABRT capable to handle double occurrences of a single archive will be much more expensive than this well tested and isolated fix in curl.

Comment 2 RHEL Program Management 2013-10-14 00:12:21 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 10 errata-xmlrpc 2015-07-22 05:42:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.