Subject: upload different in beta13

From: Bill Pemberton <[email-masked]>
Date: Fri, 6 Jun 1997 08:57:20 -0400 (EDT)

I just noticed that the upload option in ftpaccess works differently
in beta 13 (from standard wu-ftpd, it may be this way in all the betas).

Here's the part of my ftpaccess file:

upload  /ftp  /public_access  yes     ftp    ftp  0666 dirs
upload  /ftp  /public_access/*  yes     ftp    ftp  0666 dirs

With wu-ftpd this allowed anonymous to make dirs in public_access and
upload to them, and make dirs in dirs in dirs..... and all be
writable.  With beta 13 they can make 1 dirs as deep as they want, but
they can only upload to the first level down.

Anyhow, is this is a bug or a feature?

-- 
Bill Pemberton                                 [email-masked]
ITC/Unix Systems                               [email-masked]
University of Virginia                         uunet!virginia!wfp5p

---

From: Ian Willis <[email-masked]>
Date: Tue, 17 Jun 97 19:04:14 BST

>From the behaviour you describe I think you must also have the
ftpaccess line (or something similar):
upload /ftp * no

If you add "nodirs" to the end of this, then making directories would
be restricted to the same directories into which uploads were allowed.

The fact that you can now only upload into the first level down was
caused by a change I submitted which first appeared in Beta 12.
The reasoning and description of my change was:
path_compare() is used to compare two directory paths, however a
path of "/????????????/new" incorrectly matches "/pub/incoming/new".
Fixed by passing FNM_PATHNAME and adding a special test for '*' which
matches all pathnames. This makes it more consistent with the
show_message() and show_readme() directory matching.

Unfortunately this also means that /public_access/* only matches one
directory down compared to the previous behaviour where it matched all
directories under /public_access. With my change you now need to add
an entry for each directory level, e.g.
upload /ftp /public_access/* yes ftp ftp 0666 dirs
upload /ftp /public_access/*/* yes ftp ftp 0666 dirs
upload /ftp /public_access/*/*/* yes ftp ftp 0666 dirs
...
etc which I don't think is reasonable, and I can see no way to achieve
the original behaviour and still pass FNM_PATHNAME, so the patch included
below and sent to [email-masked] restores the original behaviour
by restoring the Beta 11 fnmatch() call in path_compare().

*** extensions.c.00	Tue Jun 17 16:39:05 1997
--- extensions.c	Tue Jun 17 16:39:01 1997
***************
*** 799,806 ****
  char *p2;
  #endif
  {
!     if ( (*p1 == '*' && *(p1 + 1) == '\0') ||
!          fnmatch(p1, p2, FNM_PATHNAME) == 0 ) /* 0 means they matched */
          return(strlen(p1));
      else
          return(-2);
--- 799,805 ----
  char *p2;
  #endif
  {
!     if ( fnmatch(p1, p2, NULL) == 0 ) /* 0 means they matched */
          return(strlen(p1));
      else
          return(-2);

Ian Willis
SCO Internet Engineering Group, Watford, UK

| upload different in beta13
| Bill Pemberton ([email-masked])
| Fri, 6 Jun 1997 08:57:20 -0400 (EDT)
| 
| I just noticed that the upload option in ftpaccess works differently
| in beta 13 (from standard wu-ftpd, it may be this way in all the betas).
| 
| Here's the part of my ftpaccess file:
| 
| upload /ftp /public_access yes ftp ftp 0666 dirs
| upload /ftp /public_access/* yes ftp ftp 0666 dirs
| 
| With wu-ftpd this allowed anonymous to make dirs in public_access and
| upload to them, and make dirs in dirs in dirs..... and all be
| writable. With beta 13 they can make 1 dirs as deep as they want, but
| they can only upload to the first level down.
| 
| Anyhow, is this is a bug or a feature?
| 
| --
| Bill Pemberton                                 [email-masked]
| ITC/Unix Systems                               [email-masked]
| University of Virginia                         uunet!virginia!wfp5p