0

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 MLS
without 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>

1 Answer 1

0

I found a mailing list entry from 2005.

The Proftpd developer says, that you need the mod_rename Module for Proftpd.

"....but I don't see a way how to deny (with Filename forbidden or something) an upload of file containing invalid characters in filename not affecting directories."

Source: http://osdir.com/ml/network.proftpd.user/2005-01/msg00118.html

I'm checking out the mod_rename Module.

Module: http://www.castaglia.org/proftpd/modules/mod_rename.html

Regards,

Steven

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .