Subject: Re: ftpd(8) enhancements
To: Curt Sampson <cjs@portal.ca>
From: Luke Mewburn <lukem@connect.com.au>
List: tech-userlevel
Date: 04/24/1997 20:16:25
Curt Sampson writes:
> On Thu, 24 Apr 1997, Luke Mewburn wrote:
> > Currently, all of these options are compiled in unless the
> > preprocessor #define SMALL is set.
> > I'm looking for suggestions on how to make this more configurable.
> 
> Create a /etc/ftp.conf file and put *all* configuration information
> (excepting that currently in /etc/ftpusers and /etc/ftpchroot) in
> there. Three config files is plenty for any program; if you use
> /etc/ftpconv just for the conversions, we'll need a fourth one to
> turn on and off things like README notification and so on.
> 
> For each of the features, I'd have three options: on, anonymous
> only, and off. That way we can make sure that regular users aren't
> going to get README warnings as they wander about their home
> directories.

Here's some notes I whipped up on the format of ftp.conf. It seems to
provide the level of control you want.

I'm sure there's things here that can be improved. Does this appear to
be the best way to keep control of these things?

(Note: some of these are currently controlled by #ifdefs in the
source, but this appears to be a more consistant location to set this
type of stuff)

==
given the following definitions:

CLASS		one of: none, real, anonymous, all
FILE		filename (without directory elements)
FILEGLOB	a `glob' of FILEs


lines in file /etc/ftp.conf can be one of:

display CLASS FILE
	display the contents of FILE to CLASS if it exists in the
	current directory.
	FILE is ignored if CLASS is "none".
	only displayed once per directory.

notify CLASS FILEGLOB
	notify CLASS that files matching FILEGLOB exist.
	FILEGLOB is ignored if CLASS is "none".
	only displayed once per directory.

speed CLASS
	enable "site speed" for class.

conversion CLASS SUFFIX TYPE FILE COMMAND
	setup a file conversion for CLASS.
	the conversion for SUFFIX is disabled if CLASS is "none"
	SUFFIX is the file suffix to recognise.
	TYPE is 'd' (dirs), 'f' (files), or any combination of these.
	FILE is a file, which if exists in the current directory,
	  prevents the conversion. If `.', no file is used.
	COMMAND is the command to run. `%s' is the file to retrieve,
	  sans suffix.

permit CLASS COMMAND  yes | no
	Allow or deny CLASS access to the ftpd command COMMAND.
	COMMAND can be one of: dele, mkd, rmd, umask, chmod

umask CLASS UMASK
	Set the umask(2) for CLASS to UMASK.
	If CLASS is "none", this is ignored.


lines that appear later in the file override those that appear earlier.
==