[vhffs-dev] [2172] fixed pure-ftpd patch :-)

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2172
Author:   gradator
Date:     2012-05-03 23:05:31 +0200 (Thu, 03 May 2012)
Log Message:
-----------
fixed pure-ftpd patch :-)

Modified Paths:
--------------
    trunk/vhffs-patches/pureftpd/pure-ftpd-1.0.35-altlog-syslog.patch

Modified: trunk/vhffs-patches/pureftpd/pure-ftpd-1.0.35-altlog-syslog.patch
===================================================================
--- trunk/vhffs-patches/pureftpd/pure-ftpd-1.0.35-altlog-syslog.patch	2012-05-02 23:11:57 UTC (rev 2171)
+++ trunk/vhffs-patches/pureftpd/pure-ftpd-1.0.35-altlog-syslog.patch	2012-05-03 21:05:31 UTC (rev 2172)
@@ -1,6 +1,6 @@
-diff -Nru a/man/pure-ftpd.8.in b/man/pure-ftpd.8.in
---- a/man/pure-ftpd.8.in	2011-10-31 00:37:10.000000000 +0000
-+++ b/man/pure-ftpd.8.in	2012-05-02 21:45:28.099915133 +0000
+diff -Nru a//man/pure-ftpd.8.in b//man/pure-ftpd.8.in
+--- a//man/pure-ftpd.8.in	2011-10-31 00:37:10.000000000 +0000
++++ b//man/pure-ftpd.8.in	2012-05-03 21:01:37.388156599 +0000
 @@ -402,6 +402,20 @@
  (eg.
  \fB/var/log/pureftpd.log\fR, not \fB ../log/pureftpd.log\fR).
@@ -22,10 +22,10 @@
  .B \-p first:last
  Use only ports in the range \fIfirst\fR to \fIlast\fR
  inclusive for passive\-mode downloads. This means that clients will
-diff -Nru a/src/altlog.c b/src/altlog.c
---- a/src/altlog.c	2011-10-30 20:58:07.000000000 +0000
-+++ b/src/altlog.c	2012-05-02 21:16:08.688137804 +0000
-@@ -19,30 +19,50 @@
+diff -Nru a//src/altlog.c b//src/altlog.c
+--- a//src/altlog.c	2011-10-30 20:58:07.000000000 +0000
++++ b//src/altlog.c	2012-05-03 21:01:37.388156599 +0000
+@@ -19,30 +19,48 @@
  
  static int altlog_write(const char *str)
  {
@@ -48,7 +48,6 @@
 +        openlog("pure-ftpd", log_pid, altlog_syslog_facility);
 +# else
 +        if (syslog_facility != altlog_syslog_facility) {
-+            closelog();
 +            openlog("pure-ftpd", log_pid, altlog_syslog_facility);
 +        }
 +# endif
@@ -57,7 +56,6 @@
 +        closelog();
 +# else
 +        if (syslog_facility != altlog_syslog_facility) {
-+            closelog();
 +            openlog("pure-ftpd", LOG_NDELAY | log_pid, syslog_facility);
 +        }
 +# endif
@@ -97,10 +95,51 @@
      return 0;
  }
  
-diff -Nru a/src/ftpd.c b/src/ftpd.c
---- a/src/ftpd.c	2011-12-03 06:42:06.000000000 +0000
-+++ b/src/ftpd.c	2012-05-02 21:15:57.656282264 +0000
-@@ -5943,14 +5943,35 @@
+diff -Nru a//src/ftpd.c b//src/ftpd.c
+--- a//src/ftpd.c	2011-12-03 06:42:06.000000000 +0000
++++ b//src/ftpd.c	2012-05-03 21:02:00.267744322 +0000
+@@ -5060,21 +5060,27 @@
+ #endif
+ 
+ #ifdef WITH_ALTLOG
+-    if (altlog_format != ALTLOG_NONE) {
++    if(altlog_syslog) {
+         if (altlog_format == ALTLOG_W3C) {
+-            if ((altlog_fd = open(altlog_filename, 
+-                                  O_CREAT | O_WRONLY | O_NOFOLLOW | O_EXCL,
+-                                  (mode_t) 0600)) != -1) {
+-                altlog_write_w3c_header();
+-            } else if (errno == EEXIST) {
+-                altlog_fd = open(altlog_filename, O_WRONLY | O_NOFOLLOW);
+-            } 
+-        } else {
+-            altlog_fd = open(altlog_filename,
+-                             O_CREAT | O_WRONLY | O_NOFOLLOW, (mode_t) 0600);
++            altlog_write_w3c_header();
+         }
+-        if (altlog_fd == -1) {
+-            logfile(LOG_ERR, "altlog %s: %s", altlog_filename, strerror(errno));
++    } else {
++        if (altlog_format != ALTLOG_NONE) {
++            if (altlog_format == ALTLOG_W3C) {
++                if ((altlog_fd = open(altlog_filename, 
++                                      O_CREAT | O_WRONLY | O_NOFOLLOW | O_EXCL,
++                                      (mode_t) 0600)) != -1) {
++                    altlog_write_w3c_header();
++                } else if (errno == EEXIST) {
++                    altlog_fd = open(altlog_filename, O_WRONLY | O_NOFOLLOW);
++                } 
++            } else {
++                altlog_fd = open(altlog_filename,
++                                 O_CREAT | O_WRONLY | O_NOFOLLOW, (mode_t) 0600);
++            }
++            if (altlog_fd == -1) {
++                logfile(LOG_ERR, "altlog %s: %s", altlog_filename, strerror(errno));
++            }
+         }
+     }
+ #endif
+@@ -5943,14 +5949,35 @@
                          optarg_copy);
                  }
              }
@@ -140,9 +179,9 @@
              (void) free(optarg_copy);
              break;
          }
-diff -Nru a/src/ftpd_p.h b/src/ftpd_p.h
---- a/src/ftpd_p.h	2011-09-07 05:02:03.000000000 +0000
-+++ b/src/ftpd_p.h	2012-05-02 21:27:28.623047526 +0000
+diff -Nru a//src/ftpd_p.h b//src/ftpd_p.h
+--- a//src/ftpd_p.h	2011-09-07 05:02:03.000000000 +0000
++++ b//src/ftpd_p.h	2012-05-03 21:01:37.392156437 +0000
 @@ -207,6 +207,7 @@
  };
  
@@ -151,9 +190,9 @@
  # define ALTLOG_DEFAULT ALTLOG_CLF
  #endif
  
-diff -Nru a/src/globals.h b/src/globals.h
---- a/src/globals.h	2011-10-30 22:50:45.000000000 +0000
-+++ b/src/globals.h	2012-05-02 21:16:13.740071625 +0000
+diff -Nru a//src/globals.h b//src/globals.h
+--- a//src/globals.h	2011-10-30 22:50:45.000000000 +0000
++++ b//src/globals.h	2012-05-03 21:01:37.392156437 +0000
 @@ -134,6 +134,8 @@
  #ifdef WITH_ALTLOG
  GLOBAL0(const char *altlog_filename);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/