Subject: enhancement to ftpusers file in newvirt-040 & 2.4.2-beta-15

From: Bill Nugent <[email-masked]>
Date: Sun, 16 Nov 1997 14:08:52 -0500

Howdy,

In my setup I need to restrict who can use a given virtual ftp site.  
With a large number users specifying who can use a given virtual ftp site 
with the site specific ftpusers file quickly becomes a maintenance 
headache.  Below is a replacement for checkuser() in ftpd.c which creates 
a superset of the existing ftpusers format.

The enhancement kicks in when there are two words on the line:

  <action> <user>

If <action> is 'allow' then the user will be allowed access.  If action 
is any other word (e.g., 'deny', 'disallow', 'forget', etc.) then user is 
not allowed access.  The default action of allowing access can be changed 
by setting <user> to '*'.  If the default action in a file is changed to 
deny access then backward compatibility with the old format of ftpusers 
will not work as expected.

Example:

ftpaccess:
#
# Only allow access to user1, user2 and user3
#
deny *
allow user1
allow user2
allow user3

The replacement function is attached.  I did not do this as a diff 
because I have many other patches applied to the source (redhat 4.2) and 
I felt this was more readable.

This code can be used with the standard wu-ftpd-2.4.2-beta-15 release by 
changing _path_ftpusers to _PATH_FTPUSERS.

This code comes with no warranty, claims or whatever so use at your own 
risk.  It works for me but your mileage may vary.

Enjoy.

	Bill