Article delegate-en/1561 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] FTP enhanced passive mode
17 Mar 2002 10:32:25 GMT "Marc Pohl" <>


i'm currently testing delegated 7.9.2 as a pure FTP/FTP proxy. while testing this in a linux 
environment i discovered, that i have a problem to connect with the default ftp client (BSD 
derived) to a default in.ftpd server (Version 6.5/OpenBSD, linux port 0.3.2). this client 
together with proftpd or the openBSD/ftpd together with lftp have no problems.

i investigated the problem and saw that the client sends a command EPSV (enhanced 
passive mode) to the server and the server responds to it with ".. entering enhanced passive 
mode..". but delegate knows nothing about EPSV and so establishing the data-channel will 

the first solution is to support EPSV/EPRT in delegate, but i'm no ftp wizard. so i take 
another approach inspired by the handling of this case in proftpd. if i connect to a proftpd-
server with this client the following happens:

client says: EPSV
server says: 500 EPSV not understood.
client says: PASV 

so i simply patched the ftp.c file to reject any EPSV-request by the client. most clients will fall 
back to nomal passive connections.

diff -ur delegate7.9.2/src/ftp.c delegate7.9.2-emedia/src/ftp.c
--- delegate7.9.2/src/ftp.c     Sat Mar  2 17:43:21 2002
+++ delegate7.9.2-emedia/src/ftp.c      Sun Mar 17 11:07:23 2002
@@ -4362,6 +4362,13 @@
                dp = wordScan(req,com);

+               if( strcaseeq(com,"EPSV") ){
+                       Verbose("#### EPSV -> not understood ******\n");
+                       fprintf(tc,"500 EPSV not understood.\r\n",arg);
+                       fflush(tc);
+                       continue;
+               }
                if( strcaseeq(com,"XECHO") ){


Marc Pohl 
                                 WWF Wort + Ton GmbH e-media
Tel.:  +49 221  6900 112         Kolumbastrasse 3
FAX:   +49 221  6900 150         D-50667 Koeln

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]