Subject: Confused

From: "Homer W. Smith" <[email-masked]>
Date: Mon, 9 Dec 1996 13:13:24 -0500 (EST)

I am *VERY* confused about the upload line in ftpaccess.
 
    The perms only affects anonymous mkdirs and uploads, but the
nodirs effects both anon and private ftp mkdirs.
 
    Isn't this a bit poorly designed?
 
    I wish to prevent mkdirs for anon ftp because it creates 
directories the owner can not erase.  But private ftp should
be allowed to mkdirs.
 
    Homer

------------------------------------------------------------------------------
Homer Wilson Smith     News, Web, Telnet      Art Matrix - Lightlink
(607) 277-0959         SunOS 4.1.4 Sparc 20   Internet Access, Ithaca NY
[email-masked]    [email-masked]     http://www.lightlink.com

---

From: Bob Myers <[email-masked]>
Date: Mon, 09 Dec 1996 13:14:12 -0800

> directories the owner can not erase.  But private ftp should

nodirs is definitely broken in Beta-11.  

Here is my patch.
*** extensions.c	Mon Dec  9 13:09:16 1996
--- extensions.c.~1~	Sun Apr 14 22:51:05 1996
***************
*** 962,969 ****
    i = match_value;  /* i is -1 here */
    while (getaclentry("upload", &entry) && ARG0 && ARG1 && ARG2 != NULL) {
   /* CERT suggested fix (change && to || ) */
!  /* CERT fix is broken - changing back - Bob Myers <[email-masked]> */
!     if ( (!strcmp(ARG0, pw->pw_dir))  &&
  		   ((i = path_compare(ARG1, cwdir)) >= match_value) ) {
            match_value = i;
            ap2 = ARG2;
--- 962,968 ----
    i = match_value;  /* i is -1 here */
    while (getaclentry("upload", &entry) && ARG0 && ARG1 && ARG2 != NULL) {
   /* CERT suggested fix (change && to || ) */
!     if ( (!strcmp(ARG0, pw->pw_dir))  ||
  		   ((i = path_compare(ARG1, cwdir)) >= match_value) ) {
            match_value = i;
            ap2 = ARG2;
***************
*** 974,981 ****
            if (ARG6)  ap6 = ARG6;
            else       ap6 = NULL;
        }
-   }
-   if (match_value >= 0) {
      if ( ((ap2 && !strcasecmp(ap2, "no")) && 
  	  (ap3 && strcasecmp(ap3, "dirs"))) || 
  	 (ap3 && !strcasecmp(ap3, "nodirs")) ||
--- 973,978 ----
***************
*** 983,996 ****
        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);
  }
  
--- 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);
  }
  
[24;1H[K