Subject: Problem with "upload" and Virtual Servers

From: Geoff Baysinger <[email-masked]>
Date: Fri, 24 Apr 1998 14:48:14 -0500

System: Digital Unix OSF/1 4.0D
Options: C2 security
Version: WU FTPd 2.4 beta15 w/Virtual servers

(quick question: anyone had any luck compiling beta16 -or- BeroFTPd for
OSF/1 4.0D using Virtual Servers? If so please send me a note, the "-a"
option doesn't work on beta16, and Bero won't even compile)

I've got a problem running wu-FTPd and virtual servers. I have the virtual
servers answering (have since before Christmas). The problem lies in trying
to limit uploads.

I have the following parameter in my "ftpaccess" file, which should prevent
uploads by "anonymous":

upload  /data10/ftp     *               no

And, for my non-virtual main FTP server, it does ... however, if a user
logs into a virtual server as anonymous, and the directory they hit has
permissions improperly set to allow FTP to write to it (and with 200+
customers, it happens), then they can still upload the file.

===============
Example:
  My main server is "main.hiwaay.net" ... the use logs into it and goes to
"/www.mydomain.com/pub" (which is the FTP root for a virtual server and has
777 permissions). They try to upload "blah.txt" and the server refuses it.
Good.

  But, if the user connects to a virtual server called "www.mydomain.com"
on the same machine and goes to the /pub directory (which has 777
permissions), they try to upload "blah.txt" and the server accepts it. Bad.

  In both cases they are using the same FTPd and trying to upload to the
same absolute path on the machine.
===============

My guess is that the following quote from the "ftpaccess" manpage may
explain things?

  "The upload keyword only applies to users who have a home directory (the
argument to the chroot() ) of <root-dir>."

My question is: how do I fix it? Is it possible that on a virtual server
the "anonymous" user has a different chroot() argument, but which is also
different than when a full blown user account logs in? If so I could
probably change the code, but I don't know what argument would be passed in
this case.

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 24 Apr 1998 20:02:28 -0400 (EDT)

> probably change the code, but I don't know what argument would be passed in

Hack the code and post the patch.  This is a problem I've seen too.  To be
honest, it looks like the code for this has been seriously broken in the
source.  It may take some looking to find an old enough source kit to
figure out what was changed.  I've looked at it but haven't had the time
to dig into it yet.

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              email: [email-masked] [205.133.13.8]
Kettering, OH 45409-1615 USA    voice: +1 (937) 299-7653