Hi,

Thanks for the fast answer.

I really have no idea why its working perfectly for you, but here I can get the logfile broken in 2 minutes :)

When connecting with 1 thread, everything is fine.

But when using multiple connections at once, it goes nuts.

This seems quite logic also, as now it opens logfile, and seeks the end. But what if another thread added something to the logfile?
Then the 'end' it got with the seek function is not the current end anymore?


Attached is the debdiff I made to solve the issue.
Compiled it, and running that now without problems (no corrupt log anymore).

Jean-Louis

Op 28-06-10 01:36, Daniel Baumann schreef:
Version: 2.3.0~pre2-3

On 06/28/2010 01:24 AM, Debian Bug Tracking System wrote:
This bug doesn't seem to be fixed by the supplied patch.
My vsftpd logfile still looks broken:

Mon Jun 28 00:47:13 2010 [pid 2] CONNECT: Client "IP"
Mon Jun 28 00:47:13 2010 [pid 1] [xxx] OK LOGIN: Client "81.Mon Jun 28
Mon Jun 28 00:51:13 2010 [pid 3] [xxx] OK UPLOAD: Client "81Mon Jun 28

no, it's definitely fixed and working. attached is the unmodified
logfile that i get with current vsftpd from sid on a sid/i386 system,
connecting with a couple of different clients to localhost.


diff -u vsftpd-2.3.0~pre2/debian/changelog vsftpd-2.3.0~pre2/debian/changelog
--- vsftpd-2.3.0~pre2/debian/changelog
+++ vsftpd-2.3.0~pre2/debian/changelog
@@ -1,3 +1,9 @@
+vsftpd (2.3.0~pre2-4) unstable; urgency=low
+
+  * debian/patches/10-logging.patch: Using append, as previous patch didn't 
work
+
+ -- Jean-Louis Dupond <jean-lo...@dupond.be>  Mon, 28 Jun 2010 00:35:51 +0200
+
 vsftpd (2.3.0~pre2-3) unstable; urgency=low
 
   * Adding patch from Regid Ichira <gl2n30y06a...@hotmail.com> to fix
diff -u vsftpd-2.3.0~pre2/debian/patches/10-logging.patch 
vsftpd-2.3.0~pre2/debian/patches/10-logging.patch
--- vsftpd-2.3.0~pre2/debian/patches/10-logging.patch
+++ vsftpd-2.3.0~pre2/debian/patches/10-logging.patch
@@ -1,16 +1,63 @@
+## Description: add some description
+## Origin/Author: add some origin or author
+## Bug: bug URL
 Author: Regid Ichira <gl2n30y06a...@hotmail.com>
 Description:
  In recent versions of sysutil.c, vsf_sysutil_create_or_open_file() does not
  O_APPEND anymore leading to messed up logging (Closes: #579684).
 
-diff -Naurp vsftpd.orig/logging.c vsftpd/logging.c
---- vsftpd.orig/logging.c      2009-10-19 05:24:23.000000000 +0200
-+++ vsftpd/logging.c   2010-05-02 18:20:16.000000000 +0200
-@@ -58,6 +58,7 @@ vsf_log_init(struct vsf_session* p_sess)
-         die2("failed to open vsftpd log file:", tunable_vsftpd_log_file);
-       }
-       p_sess->vsftpd_log_fd = retval;
-+      vsf_sysutil_lseek_end(retval);
-     }
+Index: vsftpd-2.3.0~pre2/logging.c
+===================================================================
+--- vsftpd-2.3.0~pre2.orig/logging.c   2009-10-19 05:24:23.000000000 +0200
++++ vsftpd-2.3.0~pre2/logging.c        2010-06-28 00:33:37.773146489 +0200
+@@ -41,7 +41,7 @@
    }
+   if (tunable_dual_log_enable || tunable_xferlog_std_format)
+   {
+-    retval = vsf_sysutil_create_or_open_file(tunable_xferlog_file, 0600);
++    retval = vsf_sysutil_create_or_append_file(tunable_xferlog_file, 0600);
+     if (vsf_sysutil_retval_is_error(retval))
+     {
+       die2("failed to open xferlog log file:", tunable_xferlog_file);
+@@ -52,7 +52,7 @@
+   {
+     if (!tunable_syslog_enable)
+     {
+-      retval = vsf_sysutil_create_or_open_file(tunable_vsftpd_log_file, 0600);
++      retval = vsf_sysutil_create_or_append_file(tunable_vsftpd_log_file, 
0600);
+       if (vsf_sysutil_retval_is_error(retval))
+       {
+         die2("failed to open vsftpd log file:", tunable_vsftpd_log_file);
+Index: vsftpd-2.3.0~pre2/sysutil.c
+===================================================================
+--- vsftpd-2.3.0~pre2.orig/sysutil.c   2010-06-28 00:35:48.440190653 +0200
++++ vsftpd-2.3.0~pre2/sysutil.c        2010-06-28 00:34:19.492210313 +0200
+@@ -1209,6 +1209,12 @@
+   return open(p_filename, O_CREAT | O_WRONLY | O_NONBLOCK, mode);
  }
+ 
++int
++vsf_sysutil_create_or_append_file(const char* p_filename, unsigned int mode)
++{
++  return open(p_filename, O_CREAT | O_WRONLY | O_NONBLOCK | O_APPEND, mode);
++}
++
+ void
+ vsf_sysutil_dupfd2(int old_fd, int new_fd)
+ {
+Index: vsftpd-2.3.0~pre2/sysutil.h
+===================================================================
+--- vsftpd-2.3.0~pre2.orig/sysutil.h   2010-06-28 00:35:48.340192976 +0200
++++ vsftpd-2.3.0~pre2/sysutil.h        2010-06-28 00:35:45.310263350 +0200
+@@ -87,8 +87,10 @@
+ int vsf_sysutil_create_overwrite_file(const char* p_filename);
+ /* Creates file or appends if already exists */
+ int vsf_sysutil_create_append_file(const char* p_filename);
+-/* Creates or appends */
++/* Creates or opens */
+ int vsf_sysutil_create_or_open_file(const char* p_filename, unsigned int 
mode);
++/* Creates or appends */
++int vsf_sysutil_create_or_append_file(const char* p_filename, unsigned int 
mode);
+ void vsf_sysutil_dupfd2(int old_fd, int new_fd);
+ void vsf_sysutil_close(int fd);
+ int vsf_sysutil_close_failok(int fd);

Reply via email to