| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_site_misc</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_site_misc</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | <p> |
| 16 | The <code>mod_site_misc</code> module implements miscellaneous |
| 17 | <code>SITE</code> commands, such as: |
| 18 | <ul> |
| 19 | <li>SITE MKDIR |
| 20 | <li>SITE RMDIR |
| 21 | <li>SITE SYMLINK |
| 22 | <li>SITE UTIME |
| 23 | </ul> |
| 24 | |
| 25 | <p> |
| 26 | This module is contained in the <code>contrib/mod_site_misc.c</code> file for |
| 27 | ProFTPD 1.2.<i>x</i>/1.3.<i>x</i>, and is not compiled by default. |
| 28 | Installation instructions are discussed <a href="#Installation">here</a>. |
| 29 | |
| 30 | <h2>Author</h2> |
| 31 | <p> |
| 32 | Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any |
| 33 | questions, concerns, or suggestions regarding this module. |
| 34 | |
| 35 | <h2>Directives</h2> |
| 36 | <ul> |
| 37 | <li><a href="#SiteMiscEngine">SiteMiscEngine</a> |
| 38 | </ul> |
| 39 | |
| 40 | <h2>Thanks</h2> |
| 41 | <p> |
| 42 | <i>2003-02-14</i>: Thanks to Kamil Burzynski (K.Burzynski <i>at</i> adbglobal.com) for providing <code>SITE MKDIR</code> and <code>SITE RMDIR</code> code<br> |
| 43 | <i>2003-10-27</i>: Thanks to Peter Hatch (pete <i>at</i> parcplace.net) for providing <code>SITE SYMLINK</code> code |
| 44 | |
| 45 | <h2><code>SITE</code> Commands</h2> |
| 46 | <ul> |
| 47 | <li><a href="#SITE_MKDIR">SITE MKDIR</a> |
| 48 | <li><a href="#SITE_RMDIR">SITE RMDIR</a> |
| 49 | <li><a href="#SITE_SYMLINK">SITE SYMLINK</a> |
| 50 | <li><a href="#SITE_UTIME">SITE UTIME</a> |
| 51 | </ul> |
| 52 | |
| 53 | <hr> |
| 54 | <h3><a name="SiteMiscEngine">SiteMiscEngine</a></h3> |
| 55 | <strong>Syntax:</strong> SiteMiscEngine <em>on|off</em><br> |
| 56 | <strong>Default:</strong> on<br> |
| 57 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 58 | <strong>Module:</strong> mod_site_misc<br> |
| 59 | <strong>Compatibility:</strong> 1.3.3c and later |
| 60 | |
| 61 | <p> |
| 62 | The <code>SiteMiscEngine</code> directive enables or disables the module's |
| 63 | runtime support for the <code>SITE</code> commands. If set to <em>off</em>, |
| 64 | this module will not support these <code>SITE</code> commands. Use this |
| 65 | directive to disable the module. |
| 66 | |
| 67 | <p> |
| 68 | <hr> |
| 69 | <h3><a name="SITE_MKDIR">SITE MKDIR</a></h3> |
| 70 | This <code>SITE</code> command allows the creation of a full directory |
| 71 | path, similar to <code>mkdir -p /path/to/dir</code>. It is primarily for |
| 72 | convenience, instead of having to use a loop of <code>MKD</code> and |
| 73 | <code>CWD</code> commands; the normal <code>MKD</code> FTP command only |
| 74 | creates a single directory at a time. |
| 75 | |
| 76 | <p> |
| 77 | The syntax for <code>SITE MKDIR</code> is: |
| 78 | <pre> |
| 79 | SITE MKDIR <i>path</i> |
| 80 | </pre> |
| 81 | |
| 82 | <p> |
| 83 | Use of this <code>SITE</code> command can be controlled via |
| 84 | <code><Limit></code> sections, <i>e.g.</i>: |
| 85 | <pre> |
| 86 | <Limit SITE_MKDIR> |
| 87 | AllowUser alex |
| 88 | DenyAll |
| 89 | </Limit> |
| 90 | </pre> |
| 91 | |
| 92 | <p> |
| 93 | <hr> |
| 94 | <h3><a name="SITE_RMDIR">SITE RMDIR</a></h3> |
| 95 | This <code>SITE</code> command allows the deletion of a full directory |
| 96 | path, similar to <code>rm -fr /path/to/dir</code>. It recursively deletes all |
| 97 | of the files and directories under the given path. This command is |
| 98 | primarily for convenience, instead of having to use a loop of <code>NLST</code>, |
| 99 | <code>DELE</code>, and <code>CWD</code> commands; the normal <code>DELE</code> |
| 100 | FTP command only deletes a single file at a time, and the normal |
| 101 | <code>RMD</code> command does not handle removing directories that are not |
| 102 | empty. |
| 103 | |
| 104 | <p> |
| 105 | The syntax for <code>SITE RMDIR</code> is: |
| 106 | <pre> |
| 107 | SITE RMDIR <i>path</i> |
| 108 | </pre> |
| 109 | |
| 110 | <p> |
| 111 | Use of this <code>SITE</code> command can be controlled via |
| 112 | <code><Limit></code> sections, <i>e.g.</i>: |
| 113 | <pre> |
| 114 | <Limit SITE_RMDIR> |
| 115 | AllowUser alex |
| 116 | DenyAll |
| 117 | </Limit> |
| 118 | </pre> |
| 119 | |
| 120 | <p> |
| 121 | <hr> |
| 122 | <h3><a name="SITE_SYMLINK">SITE SYMLINK</a></h3> |
| 123 | This <code>SITE</code> command allows the creation of symbolic links, similar |
| 124 | to <code>ln -s</code>. |
| 125 | |
| 126 | <p> |
| 127 | The syntax for <code>SITE SYMLINK</code> is: |
| 128 | <pre> |
| 129 | SITE SYMLINK <i>source</i> <i>destination</i> |
| 130 | </pre> |
| 131 | |
| 132 | <p> |
| 133 | Use of this <code>SITE</code> command can be controlled via |
| 134 | <code><Limit></code> sections, <i>e.g.</i>: |
| 135 | <pre> |
| 136 | <Limit SITE_SYMLINK> |
| 137 | AllowUser alex |
| 138 | DenyAll |
| 139 | </Limit> |
| 140 | </pre> |
| 141 | |
| 142 | <p> |
| 143 | <hr> |
| 144 | <h3><a name="SITE_UTIME">SITE UTIME</a></h3> |
| 145 | This <code>SITE</code> command allows for setting the access and modification |
| 146 | timestamps on files, similar to the <code>touch /path/to/file</code> command. |
| 147 | This allows sites to have the often-requested ability to set the modification |
| 148 | time on uploaded files. |
| 149 | |
| 150 | <p> |
| 151 | The syntax for <code>SITE UTIME</code> is: |
| 152 | <pre> |
| 153 | SITE UTIME <i>YYYYMMDDhhmm[ss]</i> <i>path</i> |
| 154 | </pre> |
| 155 | For example: |
| 156 | <pre> |
| 157 | SITE UTIME 200402240836 file.txt |
| 158 | SITE UTIME 20040224083655 file.txt |
| 159 | </pre> |
| 160 | to 8:36 AM, Febrary 24, 2004 (or 8:36:55 AM, Febrary 24, 2004, respectively). |
| 161 | |
| 162 | <p> |
| 163 | Another variant syntax is also supported: |
| 164 | <pre> |
| 165 | SITE UTIME <i>path</i> <i>YYYYMMDDhhmm[ss]</i> <i>YYYYMMDDhhmm[ss]</i> <i>YYYYMMDDhhmm[ss]</i> UTC |
| 166 | </pre> |
| 167 | For example: |
| 168 | <pre> |
| 169 | SITE UTIME file.txt 20040224083655 20040224083655 20040224083655 UTC |
| 170 | </pre> |
| 171 | |
| 172 | <p> |
| 173 | The timestamp specified is treated as being in GMT/UTC, rather than in the |
| 174 | local timezone. |
| 175 | |
| 176 | <p> |
| 177 | Use of this <code>SITE</code> command can be controlled via |
| 178 | <code><Limit></code> sections, <i>e.g.</i>: |
| 179 | <pre> |
| 180 | <Limit SITE_UTIME> |
| 181 | AllowUser alex |
| 182 | DenyAll |
| 183 | </Limit> |
| 184 | </pre> |
| 185 | |
| 186 | <p> |
| 187 | <hr> |
| 188 | <h2><a name="Installation">Installation</a></h2> |
| 189 | The <code>mod_site_misc</code> module is distributed with ProFTPD. Simply |
| 190 | follow the normal steps for using third-party modules in proftpd: |
| 191 | <pre> |
| 192 | $ ./configure --with-modules=mod_site_misc |
| 193 | </pre> |
| 194 | To build <code>mod_site_misc</code> as a DSO module: |
| 195 | <pre> |
| 196 | $ ./configure --enable-dso --with-shared=mod_site_misc |
| 197 | </pre> |
| 198 | Then follow the usual steps: |
| 199 | <pre> |
| 200 | $ make |
| 201 | $ make install |
| 202 | </pre> |
| 203 | |
| 204 | <p> |
| 205 | Alternatively, if your <code>proftpd</code> was compiled with DSO support, you |
| 206 | can use the <code>prxs</code> tool to build <code>mod_site_misc</code> as a |
| 207 | shared module: |
| 208 | <pre> |
| 209 | $ prxs -c -i -d mod_site_misc.c |
| 210 | </pre> |
| 211 | |
| 212 | <p> |
| 213 | <hr> |
| 214 | <font size=2><b><i> |
| 215 | © Copyright 2004-2017 TJ Saunders<br> |
| 216 | All Rights Reserved<br> |
| 217 | </i></b></font> |
| 218 | <hr> |
| 219 | |
| 220 | </body> |
| 221 | </html> |