1 '\" te 2 .\" Copyright (C) 2001, Sun Microsystems, Inc. All Rights Reserved 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 6 .TH FTPCONVERSIONS 4 "May 1, 2003" 7 .SH NAME 8 ftpconversions \- FTP Server conversions database 9 .SH SYNOPSIS 10 .LP 11 .nf 12 \fB/etc/ftpd/ftpconversions\fR 13 .fi 14 15 .SH DESCRIPTION 16 .sp 17 .LP 18 When the FTP Server, \fBin.ftpd\fR(1M), receives the retrieve (\fBRETR\fR) 19 command, if the specified file does not exist, it looks for a conversion to 20 change an existing file or directory of the same base name into the format 21 requested, subject to the \fBftpaccess\fR(4) \fBcompress\fR and \fBtar\fR 22 capabilities. 23 .sp 24 .LP 25 The conversions and their attributes known by \fBin.ftpd\fR(1M) are stored in 26 an \fBASCII\fR file of the following format. Each line in the file provides a 27 description for a single conversion. The fields in this file are separated by 28 colons (:). 29 .sp 30 .in +2 31 .nf 32 %s:%s:%s:%s:%s:%s:%s:%s 33 1 2 3 4 5 6 7 8 34 .fi 35 .in -2 36 .sp 37 38 .sp 39 .LP 40 The fields are described as follows: 41 .sp 42 .ne 2 43 .na 44 \fB1\fR 45 .ad 46 .RS 5n 47 \fBStrip prefix\fR. 48 .RE 49 50 .sp 51 .ne 2 52 .na 53 \fB2\fR 54 .ad 55 .RS 5n 56 \fBStrip postfix\fR. 57 .RE 58 59 .sp 60 .ne 2 61 .na 62 \fB3\fR 63 .ad 64 .RS 5n 65 \fBAddon prefix\fR. 66 .RE 67 68 .sp 69 .ne 2 70 .na 71 \fB4\fR 72 .ad 73 .RS 5n 74 \fBAddon postfix\fR. 75 .RE 76 77 .sp 78 .ne 2 79 .na 80 \fB5\fR 81 .ad 82 .RS 5n 83 \fBExternal command\fR. 84 .RE 85 86 .sp 87 .ne 2 88 .na 89 \fB6\fR 90 .ad 91 .RS 5n 92 \fBTypes\fR. 93 .RE 94 95 .sp 96 .ne 2 97 .na 98 \fB7\fR 99 .ad 100 .RS 5n 101 \fBOptions\fR. 102 .RE 103 104 .sp 105 .ne 2 106 .na 107 \fB8\fR 108 .ad 109 .RS 5n 110 \fBDescription\fR. 111 .RE 112 113 .sp 114 .LP 115 The \fBStrip prefix\fR and \fBAddon prefix\fR fields are not currently 116 supported. 117 .sp 118 .LP 119 The \fBStrip postfix\fR and \fBaddon postfix\fR fields are extensions to be 120 added to or removed from the requested \fBfilename\fR in attempting to produce 121 the name of an existing file or directory. When the attempt succeeds, the FTP 122 Server runs the external command associated with the conversion. The magic 123 cookie \fB%s\fR in the argument is passed to the command, replaced with the 124 name of the existing file or directory. 125 .sp 126 .LP 127 \fBExternal command\fR is the absolute pathname of a command to run followed by 128 the appropriate options to carry out the conversion. The standard output of the 129 command is sent back in response to the \fBRETR\fR (retrieve) command. For 130 anonymous and guest users to be able to execute the command, it must be present 131 in their \fBchroot'd\fR hierarchy along with any necessary dynamic libraries. 132 .sp 133 .LP 134 \fBTypes\fR specifies the conversion type. The following values are recognized: 135 .sp 136 .ne 2 137 .na 138 \fB\fBT_ASCII\fR\fR 139 .ad 140 .RS 11n 141 ASCII transfers are allowed of a file produced by the conversion. 142 .RE 143 144 .sp 145 .ne 2 146 .na 147 \fB\fB\fR\fBT_DIR\fR\fR 148 .ad 149 .RS 11n 150 Directories can be converted. 151 .RE 152 153 .sp 154 .ne 2 155 .na 156 \fB\fBT_REG\fR\fR 157 .ad 158 .RS 11n 159 Regular files can be converted. 160 .RE 161 162 .sp 163 .LP 164 \fBOptions\fR are checked against the \fBftpaccess\fR(4) \fBcompress\fR and 165 \fBtar\fR capabilities and are recorded in the \fBspecial-action-flag\fR field 166 that is written to the FTP Server logfile. See \fBxferlog\fR(4). The following 167 options are supported: 168 .sp 169 .ne 2 170 .na 171 \fB\fBO_COMPRESS\fR\fR 172 .ad 173 .RS 16n 174 conversion compresses 175 .RE 176 177 .sp 178 .ne 2 179 .na 180 \fB\fBO_TAR\fR\fR 181 .ad 182 .RS 16n 183 conversion archives 184 .RE 185 186 .sp 187 .ne 2 188 .na 189 \fB\fBO_UNCOMPRESS\fR\fR 190 .ad 191 .RS 16n 192 conversion uncompresses 193 .RE 194 195 .sp 196 .LP 197 You can specify more than one option by using "\fB|\fR" to separate options. 198 For example, \fBO_TAR|O_COMPRESS\fR specifies that the conversion archives and 199 compresses. 200 .sp 201 .LP 202 \fBDescription\fR is a one word description of the conversion that is used in 203 error messages returned to the FTP client. 204 .sp 205 .LP 206 Lines that begin with a \fB#\fR sign are treated as comment lines and are 207 ignored. 208 .SH EXAMPLES 209 .LP 210 \fBExample 1 \fRCompressing a Regular File for Transfer 211 .sp 212 .LP 213 The following example specifies a conversion which generates \fBfilename.Z\fR 214 by compressing an existing file \fBfilename\fR. The conversion can only be 215 applied to regular files, not directories, and the absence of \fBT_ASCII\fR 216 prevents the resulting file from being transferred in ASCII mode. 217 218 .sp 219 .in +2 220 .nf 221 : : :.Z:/usr/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS 222 .fi 223 .in -2 224 225 .LP 226 \fBExample 2 \fR Uncompressing and Transferring in ASCII Mode 227 .sp 228 .LP 229 The following example specifies a conversion that takes \fBfilename.Z\fR and 230 uncompresses it to produce \fBfilename\fR, which then can be transferred in 231 ASCII mode. 232 233 .sp 234 .in +2 235 .nf 236 :.Z: : :/usr/bin/compress -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS 237 .fi 238 .in -2 239 240 .SH FILES 241 .sp 242 .ne 2 243 .na 244 \fB\fB/etc/ftpd/ftpconversions\fR\fR 245 .ad 246 .RS 28n 247 248 .RE 249 250 .SH SEE ALSO 251 .sp 252 .LP 253 \fBldd\fR(1), \fBin.ftpd\fR(1M), \fBftpaccess\fR(4), \fBxferlog\fR(4), 254 \fBattributes\fR(5)