Subject: uploads directive in ftpaccess

From: Kenneth Simler <[email-masked]>
Date: Tue, 22 Oct 1996 10:22:23 -0400

I've looked at the docs, faqs, archives of this mailing list, etc.,
and haven't found an answer to this.  Either I misunderstand what the
upload directive in ftpaccess is supposed to control, or I'm not using the
correct entry.  Put simply, my question is:

     Can the upload directive in ftpaccess be used to turn *off* anonymous
upload permission, regardless of the mode (permissions) set on the
directories in the ~ftp hierarchy?

     Some background: I set up wu-ftpd 2.4 as per the accompanying docs,
with some supplemental help from other sources for the modes on the ~ftp
hierarchy.  Along with the usual /u/ftp/bin, /u/ftp/etc, and so forth
entries, I have the following set up:

dr-xr-xr-x   7 root     wheel        512 Oct 21 11:00 /u/ftp
dr-xr-xr-x   3 root     wheel       512 Oct 21 13:24 /u/ftp/pub
drwx-wx-wt   2 root     wheel       512 Oct 21 10:50 /u/ftp/pub/incoming

     I expected that disallowing anonymous uploads in ftpaccess would
override the write permission for anonymous users.  That is, setting the
upload directive in ftpaccess could further restrict the permissions on
/u/ftp/pub/incoming.  However, it seems that even if I try to disallow
anonymous uploads in ftpaccess, they are allowed as long as the mode set on
/u/ftp/pub/incoming is world-writable.

     If I want to permit anonymous downloads, but not anonymous uploads, I
thought the following entries in ftpaccess would do the trick; some are
probably redundant and/or useless.  

upload  /home/ftp    *                no
upload  /home/ftp    /pub/*           no
upload  /home/ftp    /bin/*           no
upload  /home/ftp    /etc/*           no
upload  /home/ftp    /pub/incoming/*  no
upload  /home/ftp    /pub/incoming*   no

I've tried several variations, without success.  All have allowed anonymous
uploads whenever the /u/ftp/pub/incoming directory is world-writable.  The
only way I have been able to turn off anonymous uploads is to turn off
world write permissions on the directory.

     Sometimes I need to permit anonymous uploads, and I would like to
control this via ftpaccess, rather than by changing the mode on
/u/ftp/pub/incoming every time.  If this can't be done, I can live with
changing the modes, but it just seemed to me that this was supposed to be
one of the things that ftpaccess can control.  

     FWIW, when I do permit anonymous uploads, the options set for <owner>,
<group>, and <mode> by the upload directive in ftpaccess seem to work just
fine.

Thanks for any and all help on this.

-Ken

-- 
Kenneth Simler
Research Associate, Cornell Food & Nutrition Policy Program 
Cornell University, Ithaca, NY  14853  USA
[email-masked]  http://mango.human.cornell.edu/kens/

---

From: Kenneth Simler <[email-masked]>
Date: Wed, 30 Oct 1996 17:16:21 -0500

Alain,

     Thank you for your suggestions.  As you noted, there was a discrepancy
between the system password file home directory for ftp ("/u/ftp") and what
I had in ftpaccess ("/home/ftp").  The two are linked, but wu-ftpd ignores
it.  I changed ftpaccess to read /u/ftp and all appears to be ok now.

     I had started thinking that I would build the beta, but then I noticed
a line in FIXES-2.4.2-BETA-11 that said the new ftpaccess man page was
updated to clarify that the home directory listed in the upload directive
MUST match the directory in /etc/passwd.

     I think that's all it needed.

Thanks again,
-Ken

At 03:29 PM 10/30/96 -0500, Alain Magloire wrote:
>> 
>> I posted the following message over a week ago, and have been surprised at
>> the complete lack of response.  I know it's not a question about the
>> current beta, which understandably is a focus of much attention, but surely
>> *someone* knows the answer to this question about the uploads directive.
>> If you do, please share it, or tell me if my question isn't clear,
>> whatever.  Thanks in advance.   -Ken
>> 
>
>[ ..attach posting deleted ..]
>
>
>Hello `Kenneth Simler'
>
>  No it's quite clear, you just stumble to a little known
>bug in wu-ftpd.
>
>To remedy you can do the followings
>
>1-  in config.h
>  a- recompile wu-ftpd with:
>     #undef UPLOAD
>  b- Use the full arsenal
>    recompile wu-ftpd with:
>     #undef UPLOAD
>     #undef OVERWRITE
>     #define PARANOID
>
>2-
>  the problem is a subtle one.
>
>  a- change your passwd entry for `ftp' in the home directory field
>       "/u/ftp" --> change for "/home/ftp"
>
>   b- don't change your passwd entry for ftp but
>      change ftpaccess for
>        upload /u/ftp       *                no
>
>3-
>  I made a patch for this somewhere, sigh ;( can't find it.
>
>--
>good day, alain
>
>

---

From: [email-masked] (Eric Watjen)
Date: Wed, 30 Oct 1996 14:41:16 -0800

>upload  /home/ftp    /pub/incoming*   no

I noticed that you specified your ftp directory to be at /u/ftp.
This should be the first parameter to the upload directive, ex.:
    upload   /u/ftp   /pub/incoming/*  no
             ^^^^^^

---------------------------------------------------------------------------
Eric Watjen
[email-masked]
---------------------------------------------------------------------------
DVP TECHDOC, Inc.                                 http://www.dvptechdoc.com
1475 South Bascom Avenue                           Phone: 408-369-5100 x216
Campbell, CA 95008                                        Fax: 408-369-5107

---------------------------------------------------------------------------