The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::FTPServer::PWP - The FTP server for PWP (personal web pages) service.

SYNOPSIS

  ftpd [-d] [-v] [-p port] [-s] [-S] [-V] [-C conf_file]

DESCRIPTION

Net::FTPServer::PWP is a Net::FTPServer server personality. This personality implements a complete FTP server with special features to support an environment we call PWP.

What we call PWP (Personal Web Pages) is a particular scenario where possibly millions of users share a pool of "stateless" FTP servers that access filesystems where their personal web pages are stored. In this scenario, it is impractical to assign a unique user-id to each user for permission control. Also, the authentication depends on an external AAA server, which in our case is a RADIUS server.

We based the implementation in the Net::FTPServer framework, which provides complete FTP server functionality. Our architecture is discussed later.

The features provided include:

  • Directory quotas

  • Authentication using the RADIUS protocol

  • Configurable root directory, supplied through the RADIUS server

RADIUS Authentication

We chose to implement a direct RADIUS authentication rather than using a service such as PAM, because we wanted to get back from the RADIUS server some of the operational parameters, such as the user quota and the home directory.

For this, we use Vendor-Specific Attributes with an arbitrarily chosen vendor identifier of 582. Of course, you can change this id in the dictionaries involved and the config file, and nobody should complain.

Please take a look at the pwp-dictionary file that was distributed along this module, in order to see the actual attributes used.

Directory quotas

This is based on Maildir++. It consist on maintaining a file (.pwpquota by default) with the size of each file in the user's directory. Every time a file is stored in the FTP space, a line is added to the .pwpquota file. The file is invalidated after a number of operations or after a given time period.

This implementation is gentle to the NFS servers we use in our network to host users' FTP space.

Currently, the recovery of space through the use of DELE commands doesn't work reliably, as the size of the deleted file is not available at the time the quota hook is called. However, a later version will most likely correct this problem.

ARCHITECTURE

Net::FTPServer::PWP provides a complete implementation for the FTP server we required for our PWP scenario. It was built by extending the existing Net::FTPServer classes, as follows:

Net::FTPServer::PWP::Server

Inherits from Net::FTPServer. Through the overloading of some key methods, introduces the user authentication and the quota mechanisms.

Net::FTPServer::PWP::FileHandle

Inherits from Net::FTPServer::Full::FileHandle. Does not provide any methods. It's there just for academic completeness.

Net::FTPServer::PWP::DirHandle.

Inherits from Net::FTPServer::Full::DirHandle. Overrides the ->delete() method to provide a work-around for a bug found in Darwin.

The complete class hierarchy is shown below. The interesting classes or modules, are the ones marked with an asterisk.

  Net::FTPServer
  |
  + Net::FTPServer::Handle
  | |
  | +-Net::FTPServer::PWP::Handle (*)
  |
  +-Net::FTPServer::PWP::Server (*)
  |
  +-Net::FTPServer::Full
  |
  +-Net::FTPServer::Full::Server
  |
  +-Net::FTPServer::Full::DirHandle
  | |
  | +-Net::FTPServer::PWP::DirHandle (*)
  |
  +-Net::FTPServer::Full::FileHandle
    |
    +-Net::FTPServer::PWP::FileHandle (*)

Note that Net::FTPServer::PWP::FileHandle and Net::FTPServer::PWP::DirHandle also inherit from Net::FTPServer::PWP::Handle. Net::FTPServer::PWP::Handle inherits from Net::FTPServer::Handle.

This double inheritance is used to implement a jail, similar to the use of chroot(), which prevents users from interacting with files or directories outside their PWP space.

CONFIGURATION

A few config file entries have been added. Please see Net::FTPServer::PWP::Server for a detailed discussion on the new entries.

FILES

  /etc/ftpd.conf

HISTORY

$Id: PWP.pm,v 1.11 2003/04/01 15:50:41 lem Exp $

1.00

Original version; created by h2xs 1.21 with options

  -ACOXcfkn
        Net::FTPServer::PWP
        -v1.00
        -b
        5.5.0
1.10

We can now hide the mount point from the client if instructed to do so in the configuration file.

1.20

Varios quota-related changes. See Net::FTPServer::PWP::Server for specific info.

Fixed typo in the docs that was causing POD errors.

AUTHORS

Luis Munoz <luismunoz@cpan.org>, Manuel Picone <mpicone@cantv.net>

COPYRIGHT

Copyright (c) 2002, Luis Munoz and Manuel Picone

SEE ALSO

Net::FTPServer(3), Net::FTPServer::PWP::Server(3), perl(1)