Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 3 product line. The current stable release is 3.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 218307

Summary: Uploaded file corrupted when two connections from same client uploading same file simultaneously
Product: Red Hat Enterprise Linux 3 Reporter: Bastien Nocera <bnocera>
Component: vsftpdAssignee: Maros Barabas <mbarabas>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: tao
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0425 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-11 18:44:33 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:
Bug Depends On:    
Bug Blocks: 250727, 392231, 392251    
Attachments:
Description Flags
better rename patch none

Description Bastien Nocera 2006-12-04 15:56:36 UTC
Opened as a clone.

This bug is about a regression caused by the patch applied.

When 2 clients are uploading files, whether or not the file exists already, the
files are created with new unique names, instead of the original filename when
none exist.

+++ This bug was initially created as a clone of Bug #171308 +++

Description of problem:
I am using Redhat EL3 (AS) Taroon Update 5 with kernel 2.4.21-32.0.1.ELsmp. The
vsftpd.conf is in /etc/vsftpd and it is started by "service vsftpd start".

The vsftpd configuration is mostly in default settings. I have tested a number
some other vsftpd version (v1.2.2 rpm package for rh9), also encounter this
problem. I have also tuned some of the vsftpd configuratons such as "enable
chroot user", "enable ascii upload" etc and this bug is reproduced in all the
tests. 

Version-Release number of selected component (if applicable):
vsftpd-1.2.1-3E.1 

How reproducible:
Always

Steps to Reproduce:
1.Launch 2 ftp connections to the ftp server
2.start uploading a file from both connections to the same destination folder
3.make sure both connections are transfering the same file simultaneously 
  

Actual Results:  the resulting upload will be corrupted with file size around
double of the orginal file

Expected Results:  A correct copy of upload from the most recent transfer (the
connection which ends later )

Additional info:

It seems that the two ftp transfer streams somehow merged due to the identical
file name.

-- Additional comment from rvokal on 2005-10-21 06:03 EST --
Created an attachment (id=120244)
rename patch for vsftpd-1.2.1

This patch renames the target file and overwrites the same file.. 

Would be great if you can test it and prove that it's correct.

Comment 1 Bastien Nocera 2006-12-04 15:58:30 UTC
vsftpd-1.2.1-3E.6

I looked through the patch that created the regression:
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=120244

And it looks like the "uniqu-ification" of the filenames is done whether a file
with such a name exists or not.

On the server:
- install vsftpd
- start up vsftp
- create a test/test user

On the client:
- Launch twice the command:
lftp -e "put /tmp/rubbish/big-file"  -u test,test rhel5
with the line:
set net:limit-rate 1024
in your ~/.lftprc

On the server, during the upload:
~test/ # ls
GUADEC-Sponsor-Brochure-Blue-2007.pdf.bz2.1
GUADEC-Sponsor-Brochure-Blue-2007.pdf.bz2.2

Problem doesn't occur with RHEL4 or RHEL5.

Comment 2 RHEL Program Management 2006-12-12 16:49:31 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.

Comment 6 Maros Barabas 2007-02-13 12:46:50 UTC
Created attachment 147984 [details]
better rename patch

Please test this patch (works for me) [but do not apply old one].

Comment 12 Red Hat Bugzilla 2007-06-11 18:44:33 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0425.html


Comment 13 Issue Tracker 2007-06-13 11:09:20 UTC
Internal Status set to 'Resolved'
Status set to: Closed by Tech
Resolution set to: 'RHEL 3.9'

This event sent from IssueTracker by rkhadgar 
 issue 107951