Subject: If you use Virtual support in ftpd READ THIS NOW!

From: Kent Landfield <[email-masked]>
Date: Thu, 6 Nov 1997 16:50:48 -0600 (CST)

If you are using Virtual Server support in newvirt or beta-15 
READ THIS NOW!

There seems to be a "logic problem" ;) in the virtual code in 
beta15.  It also appears in my version newvirt version of virtual 
server support.  The problem is this...

If someone tries to login with a valid guestuser account and uses 
a bogus password, then they enter a 'user anonymous' and type in 
a random password, the user will be authorized to access the system 
but in the wrong ftp area...  Not nice.

In otherwords the sequence is:

         login: some-valid-guestuser
      Password: bogus invalid passwd entered
           ftp> user anonymous
      Password: valid junk passwd entered
    
    wrong directory (ftp account's directory)

To correct this,

In the function user() in ftpd.c just after the 

    if (logged_in) {                    /* Now a no-op.  _H*/
        if (anonymous || guest) {
            reply(530, "Can't change user from guest login.");
            return;
        }
        end_login();
    }

on line 1089, add

    guest = 0;

and recompile it.

----------- Should end up looking like ----------------
    if (logged_in) {                    /* Now a no-op.  _H*/
        if (anonymous || guest) {
            reply(530, "Can't change user from guest login.");
            return;
        }
        end_login();
    }

    guest = 0;
    anonymous = 0;
    acl_remove();
-------------------------------------------------------

The guest flag is getting set the first time through the user() 
function and then it is not getting reset if the person fails and 
then switches to an anonymous account.  Then in the pass() function, 
with guest still set, it skips the virtual_mode check since guest 
was set and falls through to a place it should not be...
 
A new version of newvirt will be put up tonight that fixes this.  
For those that can't take the time to mess with installing new server, 
make the changes above on you current copy and reinstall.

I've Cc:'ed [email-masked] so it's queued to be fixed in the 
next release.

-- 
Kent Landfield                        Phone: 1-817-545-2502             
Email: [email-masked]             http://www.landfield.com/
Email: [email-masked]                   http://www.nfr.net/
Search the Usenet Hypertext FAQ Archive at http://www.faqs.org/faqs/