Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 154994 Details for
Bug 240553
vsftpd has a create/lock race condition which corrupts uploads
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to handle write race condition on simultaneous upload
vsftpd-2.0.5-writerace.patch (text/plain), 1.57 KB, created by
Martin Poole
on 2007-05-18 13:06:12 UTC
(
hide
)
Description:
patch to handle write race condition on simultaneous upload
Filename:
MIME Type:
Creator:
Martin Poole
Created:
2007-05-18 13:06:12 UTC
Size:
1.57 KB
patch
obsolete
>--- vsftpd-2.0.5/sysutil.h.writerace 2007-05-18 13:59:34.000000000 +0100 >+++ vsftpd-2.0.5/sysutil.h 2007-05-18 13:59:34.000000000 +0100 >@@ -91,6 +91,8 @@ > int vsf_sysutil_close_failok(int fd); > int vsf_sysutil_unlink(const char* p_dead); > int vsf_sysutil_write_access(const char* p_filename); >+/* Trucate after open */ >+int vsf_sysutil_truncate(int fd, filesize_t length); > > /* Reading and writing */ > void vsf_sysutil_lseek_to(const int fd, filesize_t seek_pos); >--- vsftpd-2.0.5/postlogin.c.writerace 2007-05-18 13:59:34.000000000 +0100 >+++ vsftpd-2.0.5/postlogin.c 2007-05-18 14:01:35.000000000 +0100 >@@ -953,6 +953,7 @@ > struct vsf_transfer_ret trans_ret; > int new_file_fd; > int remote_fd; >+ int truncit = 0; > filesize_t offset = p_sess->restart_pos; > p_sess->restart_pos = 0; > if (!data_transfer_checks_ok(p_sess)) >@@ -988,6 +989,7 @@ > if (!is_append && offset == 0) > { > new_file_fd = str_create_overwrite(p_filename); >+ truncit = 1; > } > else > { >@@ -1024,6 +1026,11 @@ > if (tunable_lock_upload_files) > { > vsf_sysutil_lock_file_write(new_file_fd); >+ if (truncit) >+ { >+ vsf_sysutil_truncate(new_file_fd, 0); >+ vsf_sysutil_lseek_to(new_file_fd, offset); >+ } > } > if (!is_append && offset != 0) > { >--- vsftpd-2.0.5/sysutil.c.writerace 2007-05-18 13:59:34.000000000 +0100 >+++ vsftpd-2.0.5/sysutil.c 2007-05-18 13:59:34.000000000 +0100 >@@ -1196,6 +1196,12 @@ > } > > int >+vsf_sysutil_truncate(int fd, filesize_t length) >+{ >+ return ftruncate(fd, length); >+} >+ >+int > vsf_sysutil_unlink(const char* p_dead) > { > return unlink(p_dead);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 240553
:
154994
|
272591