Subject: directory creation with "upload" in ftpaccess

From: Matt Hallam <[email-masked]>
Date: Fri, 21 Mar 1997 11:31:32 +0000 (GMT)

I want to make incoming files unreadable until they've been checked
so i have the following in ftpaccess..

upload /var/ftp /test   yes root daemon 0600
upload /var/ftp /test/* yes root daemon 0600

This works great. However, if an uploader does a mkdir, the directory
is created :

drwxrwxr-x   3 ftp      ftp          512 Mar 21 11:07 subdir/

Basically I want to make any new directories root owned and with "t" set 
(so they cant delete any unchecked files in there) ie: 

drwxrwxr-t   3 root     ftp          512 Mar 21 11:07 subdir/

I dont want to slap on a "nodirs" and i dont want to deny anonymous to 
delete (because i want it to be able to delete files after theyve been 
checked and chown'ed to ftp) 

Any ideas ?
TIA
	Matt

X---------------------------------------------------------------------------O
| Matthew Hallam        Systems Support Group     Email: [email-masked] |
| G.Maunsell & Ptnrs                              Phone: (0181) 6636565     |
| 160 Croydon Road,                               Fax  : (0181) 6636723     |
| Beckenham, Kent BR3 4DE                         #include <wittyquote.h>   |
O---------------------------------------------------------------------------X

---

From: Wilhelm Mueller <[email-masked]>
Date: Fri, 21 Mar 1997 16:30:59 +0100 (MET)

I've modified beta 13 to support explicit ownership and permissions
for directories.  I tried to avoid all race conditions which may occur
due to the non-atomicity of an mkdir followed by a chown, but can't
provide any warranty.  I've not yet looked into the problem with mkdir
../something.  Here's the description of my changes and the patch file:

-- 8< ------------------------------------------------------- >8 --
Bug Fixes
 -- Lines in ftpaccess containing \# may still contain a comment
    starting with # (in acl.c)
 -- If the first line of the ftpaccess file contained a #, the parser
    tried to look at its predecessor to find out if it was quoted.
    Now, the buffer has a leading '\0' (in acl.c)
 -- A `reply(530,...' contained two %s, but only one argument,
    resulting in a SEGV on Solaris 2.5.1 (in ftpd.c)
 -- If a `socket()' failed, errno was later overwritten by close,
    but still used in the error message (in ftpd.c)
 -- Some unused variables were removed (in ftpd.c)

Work Arounds
 -- If SOLARIS_2_5_BUG is defined, no file locking is done,
    as this may crash the machine. (in access.c, ftpcount.c, ftpd.c)

    (According to Sun's hotline, another work around consists in
     making sure that /dev/tcp, /dev/udp, /dev/ticotsord, and
     /dev/ticlts all exist as real devices (created with mknod and the
     same major and minor numbers, ownership, and protection as the
     ones in the real file system) in the chrooted environment of
     ftpd.)

New or Modified Functionality
 -- The upload directive in ftpaccess may additionally specify the
    protection and ownership of newly created directories
    (in extensions.c, ftpd.c)
 -- Directory creation must explicitely be permitted (in extensions.c)
 -- Command line option -d dumps contents of parsed ftpaccess file, so
    now  (in ftpd.c, acl.c)
 -- Directives in ftpaccess may be marked as using the complete
    remainder of the line (minus leading/trailing whitespace) as their
    argument (e.g., email).  The code assumes that strtok() works
    exactly as specified by ANSI C. (in acl.c)
 -- The user and group in the upload directive may be specified as
    numbers (in extensions.c)
 -- A user or group of -1 in upload suppresses the corresponding change
    of ownership.  This does not rely on your fchown() supporting this
    feature.  (in ftpd.c)
 -- DELE and RMD check permissions and log the action in the same way
    when removing a directory (in ftpd.c)
 -- if the first # in an ftpaccess line is quoted, the next one will
    still introduce a comment--formerly, all subsequent # were assumed
    to be quoted, too (in acl.c)

All user visible changes (besides the funny '\# #' behaviour) are
documented in  ftpaccess.5 and ftpd.8
-- 8< ------------------------------------------------------- >8 --
table
 !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
-- 8< ------------------------------------------------------- >8 --
-- 

  ********************************************************************
    Wilhelm Müller      [email-masked]
    Schlachte 32        Tel. (Büro/off.)  +49-421-361-10629
    D-28195 Bremen      Fax  (Büro/off.)  +49-421-361-2295

   PGP  len id        fingerprint
       2048 C2F0A2D1  B1 45 26 44 DE BB 64 7F 94 AA 3D A9 01 60 8E 0A
       1024 9548B531  AE 9A D9 4C 97 8A BC 3F 4B 25 B5 2B 1E 75 21 37
        512 48B324ED  88 5C 31 31 DD F5 37 40 DB 7F 94 21 2A 54 31 EE

======