Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Apr 2001 00:52:55 +0200 (CEST)
From:      Anders Nordby <anders@fix.no>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/26779: Update port: ftp/oftpd
Message-ID:  <20010422225255.8C4FA3CD3@totem.fix.no>

next in thread | raw e-mail | index | archive | help

>Number:         26779
>Category:       ports
>Synopsis:       Update port: ftp/oftpd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 22 16:00:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anders Nordby
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Fluxpod Information eXchange
>Environment:

	

>Description:

Update the port to the latest version: 0.3.5. Removes these patches:
patch-af_portability.c, patch-configure, patch-file_list.c and
patch-ftp_command.c.

Changes since 0.3.4:

2001-04-18, Shane Kerr <shane@time-travellers.org>
- Version 0.3.5 released.
- Changed resume code to reset offset to 0 after each file transfer.
- Set accept() socket to NONBLOCK to insure the listener doesn't get
  stuck waiting for a connection.  This is documented in the NOTES
  section for the accept() call in Linux.
- Added sendfile() support on Linux systems.

2001-04-14, Shane Kerr <shane@time-travellers.org>
- Fixed a bug caused by parsing EPRT commands.  The server doesn't
  actually allow these commands, but it bravely attempts to parse them
  anyway.  A special shout out to Anders Nordby for finding this.  The
  error caused the server to terminate on an assert() fail, which is
  good because no server corruption happened, but it's bad because the
  server terminated without any indication.  Therefore....
- Changed most assert() calls to daemon_assert() calls.  These terminate
  the application as before, but log to syslog and STDERR.
- Added ability to run as a non-daemon process.  This will allow the
  server to be started from init, for instance.
- Added support for SIGTERM and SIGINT.  If one of these is received,
  then the server closes the port 21 socket - meaning that it will
  accept no further connections.  When all existing connections have
  closed, then the server exits.  A new server may be started before
  this occurs, to handle new connections.  This allows very short
  downtimes:
      # killall oftpd; sleep 1; /etc/init.d/oftpd start
  This will result in a 1 second period of time where no new connections
  are accepted, with no existing connections closed.  It's probably best
  to wait for this second, to allow the signal time to arrive.  :)

2001-04-08, Shane Kerr <shane@time-travellers.org>
- Changed check for '/' in path - was improperly allowing escaped '/'
  characters through the check!
- Set TCP_NODELAY flag on socket - much reduced latency on control
  channel for high-speed connections.
- New and improved init script from Eric Jensen.

2001-04-07, Anders Nordby <anders@fix.no>
- FreeBSD port.

>How-To-Repeat:

	

>Fix:

diff -Nur oftpd.old/Makefile oftpd/Makefile
--- oftpd.old/Makefile	Wed Apr 11 00:16:56 2001
+++ oftpd/Makefile	Mon Apr 23 00:45:29 2001
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	oftpd
-PORTVERSION=	0.3.4
+PORTVERSION=	0.3.5
 CATEGORIES=	ftp
 MASTER_SITES=	http://www.time-travellers.org/oftpd/ \
 		http://www.freenix.no/~anders/
@@ -18,11 +18,12 @@
 DOCFILES=	README AUTHORS ChangeLog NEWS TODO BUGS
 
 CFLAGS+=	${PTHREAD_CFLAGS}
+CONFIGURE_ENV+=	LIBS="-pthread"
 
 MAN8=		oftpd.8
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/src/oftpd ${PREFIX}/libexec/oftpd
+	${INSTALL_PROGRAM} ${WRKSRC}/src/oftpd ${PREFIX}/sbin/oftpd
 .if !defined(NOPORTDOCS)
 	${INSTALL} -d -m 555 ${PREFIX}/share/doc/oftpd
 .for i in ${DOCFILES}
diff -Nur oftpd.old/distinfo oftpd/distinfo
--- oftpd.old/distinfo	Wed Apr 11 00:16:56 2001
+++ oftpd/distinfo	Sun Apr 22 13:22:56 2001
@@ -1 +1 @@
-MD5 (oftpd-0.3.4.tar.gz) = 3a10eb7a681ba9090f57b99a1a462f72
+MD5 (oftpd-0.3.5.tar.gz) = ee130d35dcef6283f892a11f01047324
diff -Nur oftpd.old/files/patch-af_portability.c oftpd/files/patch-af_portability.c
--- oftpd.old/files/patch-af_portability.c	Sat Apr  7 02:39:05 2001
+++ oftpd/files/patch-af_portability.c	Thu Jan  1 01:00:00 1970
@@ -1,10 +0,0 @@
---- src/af_portability.h.old	Sat Mar 31 12:00:46 2001
-+++ src/af_portability.h	Sat Mar 31 12:01:00 2001
-@@ -2,6 +2,7 @@
- #define AF_PORTABILITY_H
- 
- #include <netinet/in.h>
-+#include <sys/types.h>
- #include <sys/socket.h>
- 
- /* _x_ must be a pointer to a sockaddr structure */
diff -Nur oftpd.old/files/patch-configure oftpd/files/patch-configure
--- oftpd.old/files/patch-configure	Sat Apr  7 02:39:05 2001
+++ oftpd/files/patch-configure	Thu Jan  1 01:00:00 1970
@@ -1,56 +0,0 @@
---- configure.old	Sat Mar 31 12:13:17 2001
-+++ configure	Sat Mar 31 12:14:16 2001
-@@ -1121,14 +1121,14 @@
- fi
- 
- 
--echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6
--echo "configure:1126: checking for main in -lpthread" >&5
-+echo $ac_n "checking for main with -pthread""... $ac_c" 1>&6
-+echo "configure:1126: checking for main with -pthread" >&5
- ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'`
- if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-   echo $ac_n "(cached) $ac_c" 1>&6
- else
-   ac_save_LIBS="$LIBS"
--LIBS="-lpthread  $LIBS"
-+LIBS="-pthread  $LIBS"
- cat > conftest.$ac_ext <<EOF
- #line 1134 "configure"
- #include "confdefs.h"
-@@ -1158,7 +1158,7 @@
- #define $ac_tr_lib 1
- EOF
- 
--  LIBS="-lpthread $LIBS"
-+  LIBS="-pthread $LIBS"
- 
- else
-   echo "$ac_t""no" 1>&6
-@@ -2311,14 +2311,14 @@
- fi
- done
- 
--echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
--echo "configure:2316: checking for pthread_create in -lpthread" >&5
-+echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
-+echo "configure:2316: checking for pthread_create with -pthread" >&5
- ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
- if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-   echo $ac_n "(cached) $ac_c" 1>&6
- else
-   ac_save_LIBS="$LIBS"
--LIBS="-lpthread  $LIBS"
-+LIBS="$LIBS"
- cat > conftest.$ac_ext <<EOF
- #line 2324 "configure"
- #include "confdefs.h"
-@@ -2352,7 +2352,7 @@
- #define $ac_tr_lib 1
- EOF
- 
--  LIBS="-lpthread $LIBS"
-+  LIBS="$LIBS"
- 
- else
-   echo "$ac_t""no" 1>&6
diff -Nur oftpd.old/files/patch-file_list.c oftpd/files/patch-file_list.c
--- oftpd.old/files/patch-file_list.c	Sat Apr  7 02:39:05 2001
+++ oftpd/files/patch-file_list.c	Thu Jan  1 01:00:00 1970
@@ -1,14 +0,0 @@
---- src/file_list.c.old	Sat Mar 31 11:27:00 2001
-+++ src/file_list.c	Sat Mar 31 11:37:38 2001
-@@ -186,7 +186,11 @@
-     /* do a glob() */
-     memset(&glob_buf, 0, sizeof(glob_buf));
-     glob_ret = glob(pattern, GLOB_ERR, NULL, &glob_buf);
-+#ifndef GLOB_NOMATCH /* FreeBSD rocks your world */
-+    if (glob_ret == GLOB_NOCHECK) {
-+#else
-     if (glob_ret == GLOB_NOMATCH) {
-+#endif
-         fdprintf(out, "total 0\r\n");
-         return 1;
-     } else if (glob_ret == GLOB_NOSPACE) {
diff -Nur oftpd.old/files/patch-ftp_command.c oftpd/files/patch-ftp_command.c
--- oftpd.old/files/patch-ftp_command.c	Sat Apr  7 02:39:05 2001
+++ oftpd/files/patch-ftp_command.c	Thu Jan  1 01:00:00 1970
@@ -1,10 +0,0 @@
---- src/ftp_command.c.old	Sat Mar 31 11:43:43 2001
-+++ src/ftp_command.c	Sat Mar 31 11:44:01 2001
-@@ -6,6 +6,7 @@
- #include <string.h>
- #include <ctype.h>
- #include <stdio.h>
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
diff -Nur oftpd.old/files/patch-ftp_listener.c oftpd/files/patch-ftp_listener.c
--- oftpd.old/files/patch-ftp_listener.c	Sat Apr  7 02:39:05 2001
+++ oftpd/files/patch-ftp_listener.c	Sun Apr 22 14:26:56 2001
@@ -1,10 +1,11 @@
---- src/ftp_listener.c.old	Sat Mar 31 12:01:10 2001
-+++ src/ftp_listener.c	Sat Mar 31 12:01:24 2001
-@@ -3,6 +3,7 @@
-  */
- 
- #include <config.h>
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
+--- src/ftp_listener.c.orig	Wed Apr 18 23:42:48 2001
++++ src/ftp_listener.c	Sun Apr 22 14:26:41 2001
+@@ -361,7 +361,7 @@
+          if (fd >= 0) {
+              
+              tcp_nodelay = 1;
+-             if (setsockopt(fd, SOL_TCP, TCP_NODELAY, (void *)&tcp_nodelay,
++             if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void *)&tcp_nodelay,
+                  sizeof(int)) != 0)
+              {
+                  syslog(LOG_ERR,
diff -Nur oftpd.old/files/patch-ftp_session.c oftpd/files/patch-ftp_session.c
--- oftpd.old/files/patch-ftp_session.c	Sat Apr  7 02:39:05 2001
+++ oftpd/files/patch-ftp_session.c	Mon Apr 23 00:38:36 2001
@@ -1,5 +1,5 @@
---- src/ftp_session.c.orig	Thu Mar 29 00:41:18 2001
-+++ src/ftp_session.c	Sat Mar 31 12:07:49 2001
+--- src/ftp_session.c.orig	Wed Apr 18 23:43:37 2001
++++ src/ftp_session.c	Mon Apr 23 00:38:15 2001
 @@ -3,13 +3,13 @@
   */
  
@@ -15,3 +15,33 @@
  #include <fcntl.h>
  #include <sys/socket.h>
  #include <errno.h>
+@@ -1130,7 +1130,8 @@
+         /* for sendfile(), we still have to use a loop to avoid 
+            having our watchdog time us out on large files - it does
+            allow us to avoid an extra copy to/from user space */
+-#ifdef HAVE_LINUX_SENDFILE
++#ifdef FOO_HAVE_LINUX_SENDFILE
++// This doesn't work yet. I'm working with the author to fix it.
+         offset = f->file_offset;
+         file_size = stat_buf.st_size - offset;
+         while (offset < stat_buf.st_size) {
+@@ -1139,11 +1140,14 @@
+             if (amt_to_send > 65536) {
+                 amt_to_send = 65536;
+             }
+-            sendfile_ret = sendfile(socket_fd, 
+-                                    file_fd, 
+-                                    &offset, 
+-                                    amt_to_send);
+-            if (sendfile_ret != amt_to_send) {
++            sendfile_ret = sendfile(file_fd,
++                                    socket_fd, 
++                                    offset,
++                                    amt_to_send,
++                                    NULL,
++                                    NULL,
++                                    0);
++            if (sendfile_ret != 0) {
+                 reply(f, 550, "Error sending file; %s.", strerror(errno));
+                 goto exit_retr;
+             }
diff -Nur oftpd.old/pkg-descr oftpd/pkg-descr
--- oftpd.old/pkg-descr	Sat Apr  7 02:39:05 2001
+++ oftpd/pkg-descr	Sun Apr 22 15:05:15 2001
@@ -7,3 +7,5 @@
 command to list files).
 
 WWW: http://www.time-travellers.org/oftpd/
+
+- Anders Nordby <anders@fix.no>
diff -Nur oftpd.old/pkg-plist oftpd/pkg-plist
--- oftpd.old/pkg-plist	Sat Apr  7 02:39:05 2001
+++ oftpd/pkg-plist	Sun Apr 22 15:07:57 2001
@@ -1,4 +1,4 @@
-libexec/oftpd
+sbin/oftpd
 share/doc/oftpd/README
 share/doc/oftpd/AUTHORS
 share/doc/oftpd/ChangeLog
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010422225255.8C4FA3CD3>