## ProFTPD module `mod_site_misc`

The `mod_site_misc` module implements miscellaneous `SITE` commands, such as:

- SITE MKDIR
- SITE RMDIR
- SITE SYMLINK
- SITE UTIME

This module is contained in the `contrib/mod_site_misc.c` file for ProFTPD 1.2.x/1.3.x, and is not compiled by default. Installation instructions are discussed here.

## Author

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

## Thanks

2003-02-14: Thanks to Kamil Burzynski (K.Burzynski at adbglobal.com) for providing `SITE MKDIR` and `SITE RMDIR` code
2003-10-27: Thanks to Peter Hatch (pete at parcplace.net) for providing `SITE SYMLINK` code

## `SITE` Commands

- SITE MKDIR
- SITE RMDIR
- SITE SYMLINK
- SITE UTIME

## SITE MKDIR

This `SITE` command allows the creation of a full directory path, similar to `mkdir -p /path/to/dir`. It is primarily for convenience, instead of having to use a loop of `MKD` and `CWD` commands; the normal `MKD` FTP command only creates a single directory at a time.

The syntax for `SITE MKDIR` is:

      SITE MKDIR path

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

      <Limit SITE_MKDIR>
        AllowUser alex
        DenyAll
      </Limit>

## SITE RMDIR

This `SITE` command allows the deletion of a full directory path, similar to `rm -fr /path/to/dir`. It recursively deletes all of the files and directories under the given path. This command is primarily for convenience, instead of having to use a loop of `NLST`, `DELE`, and `CWD` commands; the normal `DELE` FTP command only deletes a single file at a time, and the normal `RMD` command does not handle removing directories that are not empty.

The syntax for `SITE RMDIR` is:

      SITE RMDIR path

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

      <Limit SITE_RMDIR>
        AllowUser alex
        DenyAll
      </Limit>

## SITE SYMLINK

This `SITE` command allows the creation of symbolic links, similar to `ln -s`.

The syntax for `SITE SYMLINK` is:

      SITE SYMLINK source destination

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

      <Limit SITE_SYMLINK>
        AllowUser alex
        DenyAll
      </Limit>

## SITE UTIME

This `SITE` command allows for setting the access and modification timestamps on files, similar to the `touch /path/to/file` command. This allows sites to have the often-requested ability to set the modification time on uploaded files.

The syntax for `SITE UTIME` is:

      SITE UTIME YYYYMMDDhhmm[ss] path

For example:

      SITE UTIME 200402240836 file.txt
      SITE UTIME 20040224083655 file.txt

would set the access and modification timestamps on `file.txt` to 8:36 AM, Febrary 24, 2004 (or 8:36:55 AM, Febrary 24, 2004, respectively).

The timestamp specified is treated as being in GMT/UTC, rather than in the local timezone.

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

      <Limit SITE_UTIME>
        AllowUser alex
        DenyAll
      </Limit>

## Installation

The `mod_site_misc` module is distributed with ProFTPD. Simply follow the normal steps for using third-party modules in proftpd:

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

Author: $Author: castaglia $
Last Updated: $Date: 2007/12/12 21:23:36 $

© Copyright 2004-2007 TJ Saunders
All Rights Reserved