Subject: Supporting both FTP & FTP proxy on one Host

From: Michael <[email-masked]>
Date: Thu, 06 Sep 2001 12:36:08 +1000

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

Hi,

I have fwtk installed on a Red Hat linux box with ftp-gw set up in the 
inetd.conf file.
I can ftp out of the box but I need to be able to ftp in & leave files on 
the linux box.
After reading some of the documentation I tried to compile the the code in 
tools/server/ftpd directory of the source code, this gave me 2 errors :-
1)  ftpd.c:1560: macro `strpbrk' used without args
2)  glob.c: In function `matchdir':
      glob.c:231: dereferencing pointer to incomplete type

a) Does anyone know how to fix the compile errors ?
b) Could someone possible give me information on the set up needed to make 
ftp-gw work from outside to the inside as mentioned above.

Regards
Michael Orgill

---

From: Rick Murphy <[email-masked]>
Date: Thu, 06 Sep 2001 07:09:48 -0400

>I can ftp out of the box but I need to be able to ftp in & leave files on 

I do this by using netacl to front-end ftpd. If a connection comes from 
127.0.0.1, netacl execs in.ftpd, otherwise it runs ftp-gw. To ftp to the 
firewall, you connect to the ftp-gw then "user foo@localhost" connects you 
to the local ftpd.
Something like the following in your netperm-table should work, if you 
adjust it for where your local ftp daemon lives:

netacl-ftpd:    permit-hosts 127.0.0.1 -exec /usr/bin/in.ftpd -l
netacl-ftpd:    permit-hosts * -exec /usr/local/bin/ftp-gw

>a) Does anyone know how to fix the compile errors ?

1. comment out line 1560 in ftpd.c (your header files somewhere define a 
macro for strpbrk; that line in ftpd.c defines strpbrk as a function.)
2. This is harder to fix. The recent Linux kernels don't have a "dd_fd" 
member in their dirent structure. You can change this code from
         if (fstat(dirp->dd_fd, &stb) < 0)
to
         if (fstat(dirfd(dirp), &stb) < 0)

And see if that fixes it. The existing code is using a nonstandard hook to 
grab a field that isn't guaranteed to be there.

>ftp-gw work from outside to the inside as mentioned above.

As I mentioned, use the netacl approach mentioned above. Be careful about 
patches for your ftpd.
         -Rick