Subject: Re: Spaces in filenames

From: [email-masked] (Andy Church)
Date: Thu, 30 Apr 1998 11:06:40 EDT

>>      This is due to the way wu-ftpd parses the ftpaccess file: any space
>> or tab is considered an argument delimiter.  The parser doesn't know
>> anything about regular expressions, so ^[... ] gets separated into two
>> arguments, and when they are later used by the regular expression code,
>> they don't work.  You could try putting a backslash before the space; I
>> don't know off the top of my head whether that would work.
>
>Nah.  Needs a hack if one's not already available.  This is the second
>request for this in as many months.  I'm way too busy right now, anyone
>else got time/inclination?

     I'll see if I can put something together in the next couple of days.

  --Andy Church                  | If Bell Atlantic really is the heart
    [email-masked]       | of communication, then it desperately
    www.dragonfire.net/~achurch/ | needs a quadruple bypass.

---

From: Mats Petersson <[email-masked]>
Date: Thu, 30 Apr 1998 20:08:34 +0200 (MET DST)

>     www.dragonfire.net/~achurch/ | needs a quadruple bypass.

Hello again.

I have sort of "solved it myself" I think... 

The solution in ftpaccess was to write the path filter line like this:

path-filter  anonymous  /etc/pathmsg  ^[-A-Za-z0-9_.[:space:]]*$  ^\.  ^-

Unfortunately, this still won't work with the default Linux configuration. 
After some tests I found that the re_comp() and re_exec() routines used 
in extensions.c somehow don't understand the [:space:] construct, at least 
here on my box with libc 5.4.44.

What I did was the following:
I defined HAVE_REGEX_H and REGEXEC in config.lnx to make extensions.c 
use the POSIX regcomp() and regexec() functions instead of the re_comp() 
and re_exec() ones, and added some regfree()'s at appropriate places to 
free the memory allocated by regcomp(). 
(According to the libc info file, one has to use regfree() everytime after 
a regcomp() to free any memory allocated.)

I don't know why the Linux configuration isn't set up to use the POSIX
regcomp() and regexec() from the beginning, anyway this solved the problem 
with spaces in filenames on upload.

If anyone using Linux is interested in a patch for v2.4.2-beta-15 I have 
it here.

Mats Petersson