ProFTPD module mod_comb



The mod_comb module implements non-standard COMB command.

COMB command can be found in some commercial FTP servers (SecureFTP Server, for example) and used by some clients (CuteFTP, SmartFTP, and others) to implement multistream upload.

This module takes additional sicurity checks aside to standard ProFTPD command enabling/disabling (see <Limit> instruction in ProFTPD documentation) It checks, that file segments can be deleted by user with standard DELE command and (optionally) check, that all file segments has similar names.

Installation instructions are discussed here.

Author

Please contact Lev Serebryakov <lev at serebryakov.spb.ru> with any questions, concerns, or suggestions regarding this module.

Commands

Directives


COMB

COMB command combine (append) 2 or more files together, one by one, and remove all files but first (which contains all data after combining) after that.

The syntax for COMB is:

  COMB first-segment-name second-segment-name [next-segment-name ...]

Use of COMB command can be controlled via <Limit> sections, e.g.:

  <Limit COMB>
    AllowUser alex
    DenyAll
  </Limit>

Also, this command will be denied if DELE command is disabled for segment files.

Additional segments will be deleted right after processing, so this command need additional space equivalwnt to largest segment size.


CombMaxSegmentCount

Syntax: CombMaxSegmentCount Maximum count
Default: 0 (unlimited)
Context: server config, <VirtualHost>, <Anonymous>, <Global>, <Directory>, .ftpaccess
Module: mod_comb
Compatibility: 1.3.1

The CombMaxSegmentCount directive is used to limit number of combined segements.

By default, number of combined segments is unlimited. This directive can not be set to 1, because it is meaningless value.


CombMaxSegmentSize

Syntax: CombMaxSegmentSize number[units]
Default: 0 (unlimited)
Context: server config, <VirtualHost>, <Anonymous>, <Global>, <Directory>, .ftpaccess
Module: mod_comb
Compatibility: 1.3.1

The CombMaxSegmentSize directive is used to limit size of one segment.

The given number is the number of bytes for the limit, and is followed by a units specifier of (case-insensitive) "Gb" (Gigabytes), "Mb" (Megabytes), "Kb" (Kilobytes), or "B" (bytes). The given number of bytes is multiplied by the appropriate factor.

By default, size segments is unlimited.


CombMaxTotalSize

Syntax: CombMaxTotalSize number[units]
Default: 0 (unlimited)
Context: server config, <VirtualHost>, <Anonymous>, <Global>, <Directory>, .ftpaccess
Module: mod_comb
Compatibility: 1.3.1

The CombMaxTotalSize directive is used to limit total size of all segemnts (and result file).

The given number is the number of bytes for the limit, and is followed by a units specifier of (case-insensitive) "Gb" (Gigabytes), "Mb" (Megabytes), "Kb" (Kilobytes), or "B" (bytes). The given number of bytes is multiplied by the appropriate factor.

By default, size COMB result is unlimited.


CombBufferSize

Syntax: CombBufferSize number[units]
Default: 65536 bytes
Context: server config, <VirtualHost>, <Anonymous>, <Global>, <Directory>, .ftpaccess
Module: mod_comb
Compatibility: 1.3.1

The CombBufferSize directive is used to set size of memory buffer, used for combining files. Module read and write up to this size bytes in each read/write operation.

The given number is the number of bytes for the limit, and is followed by a units specifier of (case-insensitive) "Gb" (Gigabytes), "Mb" (Megabytes), "Kb" (Kilobytes), or "B" (bytes). The given number of bytes is multiplied by the appropriate factor.

Maximum size is 1Mb and minimum size is 64Kb.


CombCheckSegmentNames

Syntax: CombCheckSegmentNames on | off
Default: on
Context: server config, <VirtualHost>, <Anonymous>, <Global>, <Directory>, .ftpaccess
Module: mod_comb
Compatibility: 1.3.1

The CombCheckSegmentNames directive is used to turn on and off additional security check for segment file names.

If this check is turned on, all segment names must have common prefix and first segment name (result file name) must be equal to this prefix. This check protects from combining (and removing) completely unrelated files.


Installation

The mod_comb module is distributed outside ProFTPD. Copy mod_comb.c file into
  proftpd-dir/contrib/

Follow the normal steps for using third-party modules in proftpd:

  ./configure --with-modules=mod_site_misc
  make
  make install

Download

Download version 0.1 (first public release) here.



© Copyright 2008 Lev Serebryakov
All Rights Reserved