From: TJ S. <cas...@us...> - 2010-01-05 17:02:03
|
Update of /cvsroot/pdd/www.proftpd.org/docs/howto In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv31382 Modified Files: Filters.html Log Message: Updating website copy of Filters howto. Index: Filters.html =================================================================== RCS file: /cvsroot/pdd/www.proftpd.org/docs/howto/Filters.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Filters.html 17 Aug 2007 00:11:26 -0000 1.1 --- Filters.html 5 Jan 2010 17:01:54 -0000 1.2 *************** *** 91,94 **** --- 91,138 ---- <p> + <b>Examples</b><br> + To prevent clients from using paths which may contain non-printable characters + (<i>e.g.</i> CR, LF, VB, <i>etc</i>), you can use the following + <code>PathDenyFilter</code> pattern: + <pre> + PathDenyFilter [^[:print:]] + </pre> + Alternatively, you could use a <code>PathAllowFilter</code> which only + <i>allows</i> printable characters in paths: + <pre> + PathAllowFilter [[:print:]] + </pre> + And if you want to prevent spaces and tabs from appearing in paths, you + can use: + <pre> + PathDenyFilter [[:blank:]] + </pre> + + <p> + In ProFTPD 1.3.3rc1 and later, you can use the <code>AllowFilter</code> and + <code>DenyFilter</code> configuration directives inside of + <code><Limit></code> sections, so that those <code>Filter</code> + directives only apply to the FTP commands listed in the + <code><Limit></code> section. This means you can specify regular + expression filters for the arguments for specific commands. For example, + you may want to configure a directory that only allows uploads of files with + specific extensions. You <i>could</i> use <code>PathAllowFilter</code> for + this -- but <code>PathAllowFilter</code> also applies to the <code>MKD</code> + command, and you might want to allow users to create subdirectories in your + special directory. Thus you only want your regular expression to apply + to the <code>STOR</code> command in your directory. Below is an example + of how to do this using <code>AllowFilter</code>: + <pre> + <Directory <i>/path/to/dir</i>> + <Limit STOR> + Order deny, allow + AllowFilter \.<i>ext</i>$ + </Limit> + </Directory> + </pre> + The key is the <code>Order</code> directive; without it, the configuration + will not work as you expect. + + <p> <hr> Last Updated: <i>$Date$</i><br> |