SUMMARY: allowing characters in /etc/ftpd/ftpaccess

From: Christopher Barnard <cbarnar1_at_earthlink.net>
Date: Thu Dec 16 2010 - 22:38:41 EST
I asked:
> I need to allow / and a space as valid characters for uploading on our ftp
> site.  So I edited the path-filter line /etc/ftpd/ftpaccess.
>
> first I added "\/" to the end of the regex to allow /.  That works fine.
>
> path-filter     guest,anonymous /etc/ftpd/filename.msg  ^[-A-Za-z0-9._\/]*$
> ^[.-]
>
> But I have not been successful in allowing the space no matter what I try.
I
> have added a space at the end of the regex, I have escaped it with a
> backslash, I have tried \s, I have tried \x20.  I have added [/s] in a
> separate block.
> None of those allowed it.
>
> ^[-A-Za-z0-9._\/ ]
> ^[-A-Za-z0-9._\/\ ]
> ^[-A-Za-z0-9._\/\s]
> ^[-A-Za-z0-9._\/\x20]
> ^[-A-Za-z0-9._\/][\s]
>
> Spaces are valid characters in filenames, so they need to be valid
> characters when a user wants to upload something to his or her ftp
> directory.  I'm sure that I am not the only one who has been tasked to
> get this done.  Solutions, suggestions, etc much appreciated.


The solution:

Ah, you gotta love standards.  Especially because there are so many to choose
from.

In the case of the ftpaccess file, the regex of choice represents a space as
[:space:].

So ^[-A-Za-z0-9,_\/[:space:]] is what I needed.

Thanks to
 	A.Kirby@surrey.ac.uk
	Hugh Sasse <hgs@dmu.ac.uk>
	 Crist Clark <Crist.Clark@globalstar.com>


Christopher L. Barnard
-------------------
comment your code as if the maintainer is a homicidal maniac who knows where
you live.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Dec 16 22:38:59 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:17 EST