ProFTPD module mod_md5fs



This module is contained in the mod_md5fs.c file for ProFTPD 1.2, found here, and is not compiled by default. Installation instructions are discussed here.

When a file is uploaded into a mod_md5fs-configured directory, a MD5 digest of the uploaded file is automatically calculated. This MD5 digest is written automatically to a file in the same directory. For example, if a file "file.txt" is uploaded into a mod_md5fs directory, a file "file.txt.md5" will also automatically be written. The contents of this .md5 file are identical to the output of the common md5sum command.

This .md5 file is useful for large uploads, where the sender wants to be certain that the file was received by the server intact. By comparing the autogenerated .md5 file's MD5 digest with an MD5 digest of the large file calculated by the client before sending, the sender can verify the upload.

The most current version of mod_md5fs can be found at:

  http://www.castaglia.org/proftpd/

Author

Please contact TJ Saunders <tj at castaglia.org> with any questions, concerns, or suggestions regarding this module.

Thanks

2001-12-18: Thanks to Bill Fenner for the initial ideas for this module

2002-08-08: Thanks to Jonas Jensen for noting the problems when using SITE MD5 in a DefaultRoot login, and on non-regular files (e.g. directories).

Directives

SITE Commands


MD5FS

Syntax: MD5FS path
Default: None
Context: server config, <VirtualHost>, <Global>, <Anonymous>
Module: mod_md5fs
Compatibility: 1.2.5rc1 and later

This directive specifies a path to a directory. Files uploaded to that directory (and its subdirectories) will automatically have MD5 digests calculated and printed to a file.md5 file. Multiple directories can be configured with multiple MD5FS directives.

Example:

  # path can use "~/" notation, in which case the path is resolved after successful login
  MD5FS ~/public_ftp/md5

  # calculate digests in the normal upload directory
  MD5FS /path/to/upload/dir

SITE MD5

This SITE command accepts a single parameter, the path to the file of which to obtain the MD5 digest, and can only be used once the client has successfully logged in. When allowing this command to be used, it is best to limit its use to trusted clients, e.g.:

  <Limit SITE_MD5>
    Allow ...
    DenyAll
  </Limit>
for calculating the sum for large files can be CPU-intensive.

Example:

ftp> quote SITE MD5 HelloWorld.txt
200-9af2f8218b150c351ad802c6f3d66abe    HelloWorld.txt
200 Please contact root@familiar.castaglia.org if this digest is inaccurate

Use of this SITE can be controlled via <Limit>, e.g.:

  <Limit SITE_MD5>
    AllowUser stan
    DenyAll
  </Limit>



Installation

After unpacking and patching the latest proftpd-1.2 source code, copy the mod_md5fs.c file into:
  proftpd-dir/contrib/
Then follow the normal steps for using third-party modules in proftpd:
  ./configure --with-modules=mod_md5fs
  make
  make install



Author: $Author: tj $
Last Updated: $Date: 2003/06/24 06:49:56 $


© Copyright 2000-2002 TJ Saunders
All Rights Reserved