COPYRIGHT POLICY
----------------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
You should have received a copy of the GNU General Public License along
with this program; if not, write to Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA.

Copyright (C) 1998 Luc Deschenaux <lcd@gkb.com>


DISCLAIMER
----------
Use it at your own risk. You're sole responsible for anything that could
happend before, while, after or without using this program.


ABOUT VFTPD
-----------
vftpd means virtual ftp server daemon. It allow you to create virtual ftp
accounts. It runs on Linux and Win32 platforms. MacOs port is the next step :)

vftpd acts like an opaque proxy server. You connect your ftp client on the
vftpd using a local account you created with command vftpdusers, and the vftpd
connects you to the remote ftp server, using the remote account details you
specified in the local account. IP access rules are defined with command
vftpdaccess.

The commands the ftp client sends to the vftpd are filtered and forwarded
to the remote ftp server. This way you can specify another root directory, add
file access restrictions to avoid deleters, add a ratio, set a maximum number
of simultaneous users, autoban abusing users..

You can also specify a cache directory. If the file is already in the cache,
it will be transmitted from here instead of the remote ftp server. The cache
may become corrupted because only the name and the size of the file are
actually used to tell if the cached file should be ignored, replaced,
transmitted and/or completed.
                                         
vftpd is still an alpha release but I'm working on it everyday and I test it
while I work on it. So it's already well tested even if some major parts are
still missing (eg: console, global preferences dialog, MacOS support, etc..)
I'll release the source code after each major step. Now it just works fine
as a daemon on my 2.0.35 kernel and as background application in Windows.
I did not tested the Windows version very well..(I had no local FTP server
up..) .. but it should work..
 
I worked 29 days on it for nothing, I'm licensing it for nothing...
But if you think my work is worth more than nothing you could become
a registered $pon$or sending first a mail to lcd@gkb.com.


USING VFTPD:                           
------------

You'll need Tcl/Tk 8.0 (I'm using 8.0.3)
You can obtain it at www.sunscript.com

LINUX
-----

1. Compile (optional) and install.
   From the linux directory..
   Type ./build, then ./install. Following files will be installed:

   /usr/local/sbin/vftpd
   /usr/local/sbin/vftpdusers
   /usr/local/sbin/vftpdaccess
   /usr/local/sbin/vftpd_eduser
   /usr/local/sbin/vftpd_users
   /usr/local/sbin/vftpd_init
   /usr/local/sbin/vftpd_ipaccess

   Other files created at runtime:
   /etc/vftpd.users
   /etc/vftpd.allow
   /etc/vftpd.deny
   /etc/vftpd.autoban
   /var/run/vftpd.pids
   /var/run/vftpd.ham

2. Setup accounts with command vftpdusers.
   tip: to create an account from an existing one, edit it and change the 
   username.
 
3. Setup IP access and autoban with vftpdaccess.
   Connection will be refused if IP doesn't match an allow rule.
   Connection will be refused if IP match a deny rule even if it matched
   also an allow rule.
   IPs entered here are compared with leftmost part of the connecting
   entity's IP. eg: "1.2.3" will match "1.2.3.x", a "*" alone means
   "any address".

4. Add one or more line like those ones in /etc/inetd.conf (one per ip/port used) :

   ftp      stream  tcp     nowait  root    /usr/sbin/tcpd  vftpd -d -i host1.domain.com -p 21
   8888     stream  tcp     nowait  root    /usr/sbin/tcpd  vftpd -d -i host2.domain.com -p 8888

 vftpd options:
   required: -d             # if vftpd is launched by inetd (can't run without it actually..)
             -p <port>      # the port specified at the beginning of the line.. 
   optional: -i <ip>        # on multihomed systems you may need to specify the address to bind.
             -l <level>     # log level (0-7)

5. Restart inetd :  killall -HUP inetd


WINDOWS
-------

Remember: You'll need Tcl/Tk 8.0 (I'm using 8.0.3)
          You can obtain it at www.sunscript.com

1. Optional. Define _WIN32 then compile .\src\vftpd.c as usual
   Put vftpd.exe in directory .\win32.

2. Setup accounts with script .\win32\vftpdusers.tcl
   tip: to create an account from an existing one, edit it and change the 
   username.
 
3. Setup IP access and autoban with .\win32\vftpdaccess.tcl
   Connection will be refused if IP doesn't match an allow rule.
   Connection will be refused if IP match a deny rule even if it matched
   also an allow rule.
   IPs entered here are compared with leftmost part of the connecting
   entity's IP. eg: "1.2.3" will match "1.2.3.x", a "*" alone means
   "any address".

4. Run .\win32\vftpd.exe (you can create a shortcut or run it from console
   in order to use the -i, -p and -l options (see linux install, step 4))
   Command output will be saved in logfiles unless when -l 0 is specified.
  

MACOS
-----

1. Wait ! It's not yet finished...


HISTORY
-------

Oct 8 1998  -  Started
Oct 28 1998 -  0.0a First alpha release (user editor unusable... sorry..) 
Oct 29 1998 -  0.1a Fixed filenames in tcl scripts... vftpdusers is now working.
Oct 31 1998 -  0.2a Fixed a bug in CWD. Messages reported to syslogd. IP restricted
               access (global level) and autoban added.
Nov 6 1998  -  0.3a Added WIN32 support(...). Autoban works also when remote server is
               full, fixed syslog ^M bug and maybe some others.
Nov 8 1998  -  0.4a Fixed -l bug in WIN32 version, Empty config files are now closed.
	       MACOS port is in progress. 


