Hello,
Here are some patches for the current net/pure-ftpd port with bug fixes
backported from the upcoming 1.0.21 version.

- Don't bail out if the specified log file is a pipe instead of a regular
file,
- Avoid premature end of uploads,
- Disable the Nagle algorithm on the connection socket,
- Always call tzset() before chroot() in order to have the right time zone in
syslog logs.

 Best regards,
-Frank.


diff -urN net/pure-ftpd.orig/Makefile net/pure-ftpd/Makefile
--- net/pure-ftpd.orig/Makefile Thu Dec 16 01:31:24 2004
+++ net/pure-ftpd/Makefile      Wed Feb 15 23:01:20 2006
@@ -3,6 +3,7 @@
 COMMENT=       "small, easy to set up, fast and very secure FTP server"
 
 DISTNAME=      pure-ftpd-1.0.20
+PKGNAME=       ${DISTNAME}p0
 CATEGORIES=    net
 MASTER_SITES=  ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \
                
ftp://ftp2.fr.pureftpd.org/pub/mirrors/ftp.fr.pureftpd.org/pub/pure-ftpd/releases/
 \
diff -urN net/pure-ftpd.orig/patches/patch-src_altlog_c 
net/pure-ftpd/patches/patch-src_altlog_c
--- net/pure-ftpd.orig/patches/patch-src_altlog_c       Thu Jan  1 01:00:00 1970
+++ net/pure-ftpd/patches/patch-src_altlog_c    Wed Feb 15 22:58:42 2006
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- src/altlog.c.orig  Sun Feb 29 22:49:27 2004
++++ src/altlog.c       Wed Feb 15 22:58:26 2006
+@@ -31,7 +31,11 @@ static int altlog_write(const char *str)
+     lock.l_pid = getpid();
+     lock.l_type = F_WRLCK;
+     while (fcntl(altlog_fd, F_SETLKW, &lock) < 0 && errno == EINTR);
+-    if (lseek(altlog_fd, (off_t) 0, SEEK_END) < (off_t) 0) {
++    if (lseek(altlog_fd, (off_t) 0, SEEK_END) < (off_t) 0
++# ifdef ESPIPE
++      && errno != ESPIPE
++# endif
++      ) {
+         return -1;
+     }
+     (void) safe_write(altlog_fd, str, (size_t) left);
diff -urN net/pure-ftpd.orig/patches/patch-src_ftpd_c 
net/pure-ftpd/patches/patch-src_ftpd_c
--- net/pure-ftpd.orig/patches/patch-src_ftpd_c Thu Jan  1 01:00:00 1970
+++ net/pure-ftpd/patches/patch-src_ftpd_c      Wed Feb 15 22:58:41 2006
@@ -0,0 +1,33 @@
+$OpenBSD$
+--- src/ftpd.c.orig    Sat Jul 17 15:28:22 2004
++++ src/ftpd.c Wed Feb 15 22:58:26 2006
+@@ -3686,7 +3686,7 @@ void dostor(char *name, const int append
+         tv.tv_usec = 0;        
+         if (xferfd == -1 ||
+             select(xferfd + 1, &rs, NULL, NULL, &tv) <= 0 ||
+-            FD_ISSET(0, &rs) || !(safe_fd_isset(xferfd, &rs))) {
++            (FD_ISSET(0, &rs) && !(safe_fd_isset(xferfd, &rs)))) {
+             databroken:
+ #ifdef QUOTAS
+             (void) dostor_quota_update_close_f(overwrite, filesize,
+@@ -4435,6 +4435,11 @@ static void doit(void)
+         setsockopt(0, SOL_SOCKET, SO_OOBINLINE, 
+                    (char *) &fodder, sizeof fodder);
+ #endif
++#ifdef TCP_NODELAY
++      fodder = 1;
++      setsockopt(1, IPPROTO_TCP, TCP_NODELAY,
++                 (char *) &fodder, sizeof fodder);
++#endif
+         keepalive(0, 0);
+         keepalive(1, 0);            
+     }
+@@ -4862,6 +4867,8 @@ int main(int argc, char *argv[])
+     (void) setlocale(LC_COLLATE, "");
+ # endif
+ #endif    
++    
++    tzset();
+     
+ #ifndef SAVE_DESCRIPTORS
+     openlog("pure-ftpd", LOG_NDELAY | log_pid, DEFAULT_FACILITY);
diff -urN net/pure-ftpd.orig/patches/patch-src_pure-quotacheck_c 
net/pure-ftpd/patches/patch-src_pure-quotacheck_c
--- net/pure-ftpd.orig/patches/patch-src_pure-quotacheck_c      Thu Jan  1 
01:00:00 1970
+++ net/pure-ftpd/patches/patch-src_pure-quotacheck_c   Wed Feb 15 22:58:42 2006
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- src/pure-quotacheck.c.orig Sun Feb 29 22:49:27 2004
++++ src/pure-quotacheck.c      Wed Feb 15 22:58:26 2006
+@@ -288,7 +288,9 @@ int main(int argc, char *argv[])
+     (void) setlocale(LC_COLLATE, "");
+ # endif
+ #endif           
+-    
++
++    tzset();
++      
+     while ((fodder = getopt(argc, argv, "d:g:u:h")) != -1) {
+         switch(fodder) {
+         case 'h':

Reply via email to