I'm trying to set up my ftp server properly, but I have a problem with the AllowFilter.
The Description:
I want to restrict all commands by default and only allow a few. That works. However. As you can see in my config I want to restrict all commands, just allow
LIST CDUP CWD XCWD XCUP MKD RETR RMD PWD MLSwithout the AllowFilter
and
STOR STOU RNFR RNTO DELE
with the AllowFilter
That all works fine, but here comes the strange part.
The Problem:
If I try to rename a directory, the Operation is not permitted, because I'm using the AllowFilter with "RNFR RNTO" to prevent other file extensions. I only want to allow .zip and .rar files.
My question: How can I disable the RNTO and RNFR command only on folders.
The filter is working fine for files (you cannot rename test.zip to test.exe), but I dont want to enable it on folders.
<Directory />
<Limit ALL>
DenyAll
</Limit>
<Limit LIST CDUP CWD XCWD XCUP MKD RETR RMD PWD MLSD>
AllowAll
</Limit>
<Limit STOR STOU RNFR RNTO DELE>
Order deny, allow
AllowFilter ^[a-zA-Z0-9-_].*\.(zip|rar)$
</Limit>
</Directory>