Description of problem: Vsftpd added file locking 2.0.3. However, the implementation is not working and corrupts files. Version-Release number of selected component (if applicable): 2.0.5-10.el5 How reproducible: Start two FTP sessions writing to the same file. After the upload, the file will be corrupt. Steps to Reproduce: (In two different terminals) $ date; curl -s -T bigfile --user noland:password ftp://localhost/vsftpd-file-locking; date Mon Jan 14 19:06:51 CST 2008 Mon Jan 14 19:07:20 CST 2008 $ date; curl -s -T bigfile --user noland:password ftp://localhost/vsftpd-file-locking; date Mon Jan 14 19:06:52 CST 2008 Mon Jan 14 19:07:50 CST 2008 Actual results: $ ls -l vsftpd-file-locking bigfile -rw-r--r-- 1 noland users 512000000 2008-01-14 18:17 bigfile -rw-r--r-- 1 noland users 1019576320 2008-01-14 19:07 vsftpd-file-locking Expected results: vsftpd-file-locking should be an exact copy of bigfile. Additional info: I fixed the behavior with the following change sysutil.c. vsf_sysutil_create_overwrite_file(const char* p_filename) { // return open(p_filename, O_CREAT | O_TRUNC | O_WRONLY | // O_APPEND | O_NONBLOCK, // tunable_file_open_mode); return open(p_filename, O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK, tunable_file_open_mode); }
Woops, just saw 240553.
*** This bug has been marked as a duplicate of 240553 ***