Subject: Bug in mkdir handling (wu-ftpd 2.4.2-academ[beta-11])

From: [email-masked] (Bob Myers)
Date: Thu, 26 Sep 1996 11:13:57 -0700

Mkdir handling is wrong on wu-2.4.2-academ[BETA-11] - if there is any
"upload" configuration entry with "nodirs" on it, no subdirectories
can be created at all in any location.  No check to see if the upload
command matches the current directory is made.

Here is a patch:

*** src/extensions.c.~1~	Sun Apr 14 22:51:05 1996
--- src/extensions.c	Thu Sep 26 11:02:19 1996
***************
*** 973,978 ****
--- 973,980 ----
            if (ARG6)  ap6 = ARG6;
            else       ap6 = NULL;
        }
+   }
+   if (match_value >= 0) {
      if ( ((ap2 && !strcasecmp(ap2, "no")) && 
  	  (ap3 && strcasecmp(ap3, "dirs"))) || 
  	 (ap3 && !strcasecmp(ap3, "nodirs")) ||
***************
*** 980,992 ****
        reply(530, "%s: Permission denied.  (Mkdir)", name);
        return(0);
      }
    }
-   if (ap3)
-      *uid = atoi(ap3);    /* the uid  */
-   if (ap4) {
-      *gid = atoi(ap4);    /* the gid */
-      *valid = 1;
-    }
    return(1);
  }
  
--- 982,995 ----
        reply(530, "%s: Permission denied.  (Mkdir)", name);
        return(0);
      }
+ 
+     if (ap3)
+       *uid = atoi(ap3);    /* the uid  */
+     if (ap4) {
+       *gid = atoi(ap4);    /* the gid */
+       *valid = 1;
+     }
    }
    return(1);
  }

-- 
Bob Myers                              InteleNet Communications, Inc.
Email: [email-masked]               30 Executive Park, Suite 150
Phone: 714-851-8250 x227               Irvine, CA 92614
Fax:   714-851-1088                    http://www.intelenet.net/

---

From: Perry Rovers <[email-masked]>
Date: Fri, 27 Sep 1996 23:02:35 +0200 (MET DST)

> command matches the current directory is made.
I can't seem to reproduce this on FreeBSD 2.1.5 with beta-11 or on Linux
RedHat 3.0.3 with beta-9.
The following is a part of one of my ftpaccess files:

# uploads to incoming only, ownership of files will be root.daemon, 
# permisssions will be 0400 and no directory creation is allowed
upload /home/ftp * no
upload /home/ftp incoming yes root daemon 0400 nodirs

With this I'm unable to create dirs in /home/ftp as user ftp, but
I can create dirs as a 'real' user somewhere else. Is that behavior 
impossible with your configuration?

-- 
Perry Rovers, Amsterdam (and a number of other places), The Netherlands
Mail: mailto:[email-masked]       | Amsterdam is zo'n gezellige stad
FTP : ftp://ftp.iaehv.nl/pub/users/perry | omdat er zo verdomd veel
WWW : http://www.iaehv.nl/users/perry    | Brabanders wonen - Hans van Mierlo