Subject: TAKE 3: ftpd(8) enhancements
To: None <tech-userlevel@NetBSD.ORG>
From: Luke Mewburn <>
List: tech-userlevel
Date: 06/10/1997 23:25:56
In early May I floated around some ideas on enhancing ftpd(8), that
I felt would provide a lot of the functionality that wu-ftpd provides
(especially the file conversion stuff a la "get foo.tar.gz" where foo
is a directory, to automagically convert to a gzipped tar stream),
whilst maintaining a cleaner, smaller code-base.

Well, the code is done. It's ~1000 lines of diffs, of which > 400
lines is man page modifications. Total code size growth; in development
on my i386 it fluctuated between 48K (the original) and 52K (the final)
as I moved stuff around.

So, what does it add? Mainly, support for ftpd.conf. I've attached
the relevant info from ftpd(8) at the end of this message.

If anybody wants to test this before I commit (in a few days, barring
major hassles), please email me ASAP.


     The file /etc/ftpd.conf is used to configure various options.  Each line
     starting with a ``#'' is a comment (and ignored), and all other non-blank
     lines are treated as configuration directives.

     Each configuration line may be one of:

     conversion class suffix [type disable command]
	   Define an automatic in-line file conversion.	 If a file to retrieve
	   ends in suffix, and a real file (sans suffix) exists, then the out-
	   put of command is returned instead of the contents of the file.

		 suffix	  The suffix to initiate the conversion.

		 type	  A list of valid filetypes for the conversion.	 Valid
			  types are: `f' (file), and `d' (directory).

		 disable  The name of file that will prevent conversion if it
			  exists.  A filename of . will prevent this disabling

		 command  The command to run for the conversion.  `%s' is re-
			  placed with the requested file, sans suffix.

     display class [file]
	   If file is given and class isn't ``none'', then display the con-
	   tents of fileglob to the user the first time that the directory is

     maxtimeout class time
	   Set the maximum timeout period that a client may request, default-
	   ing to two hours.  This cannot be lesser than 30 seconds, or the
	   value for timeout. Ignored if class is ``none'' or time isn't spec-

     nomodify class [off]
	   If class is ``none'' or off is given, enable the following com-
	   mands: CHMOD, DELE, MKD, RMD, and UMASK.  Otherwise, disable them.

     notify class [file]
	   If fileglob is given and class isn't ``none'', then the user is no-
	   tified of the existence of files matching fileglob the first time
	   that the directory is entered.

     speed class [off]
	   If class is ``none'' or off is given, disable SITE SPEED.  Other-
	   wise, enable.

     timeout class time
	   Set the inactivity timeout period.  (the default is fifteen min-
	   utes).  This cannot be lesser than 30 seconds, or greater than the
	   value for maxtimeout. Ignored if class is ``none'' or time isn't

     umask class umaskval
	   Set the umask to umaskval. Ignored if class is ``none'' or umaskval
	   isn't specified.

     In any configuration line, class is one of:
	   real	   Normal user logins.
	   chroot  Users that have been chroot(2)ed.
	   guest   ``anonymous'' and ``ftp'' users.
	   all	   Matches any class.
	   none	   Matches no class.

     The following defaults are used:
	   display     none
	   maxtimeout  all    7200   # 2 hours
	   nomodify    none
	   nomodify    guest
	   notify      none
	   speed       none
	   timeout     all    900    # 15 minutes
	   umask       all    027
	   umask       guest  0707