ftpconversions.4 revision c10c16dec587a0662068f6e2991c29ed3a9db943
te
Copyright (C) 2001, Sun Microsystems, Inc. All Rights Reserved
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.
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.
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]
ftpconversions 4 "1 May 2003" "SunOS 5.11" "File Formats"
NAME
ftpconversions - FTP Server conversions database
SYNOPSIS

/etc/ftpd/ftpconversions
DESCRIPTION

When the FTP Server, in.ftpd(1M), receives the retrieve (RETR) command, if the specified file does not exist, it looks for a conversion to change an existing file or directory of the same base name into the format requested, subject to the ftpaccess(4) compress and tar capabilities.

The conversions and their attributes known by in.ftpd(1M) are stored in an ASCII file of the following format. Each line in the file provides a description for a single conversion. The fields in this file are separated by colons (:).

%s:%s:%s:%s:%s:%s:%s:%s
 1 2 3 4 5 6 7 8

The fields are described as follows:

1

Strip prefix.

2

Strip postfix.

3

Addon prefix.

4

Addon postfix.

5

External command.

6

Types.

7

Options.

8

Description.

The Strip prefix and Addon prefix fields are not currently supported.

The Strip postfix and addon postfix fields are extensions to be added to or removed from the requested filename in attempting to produce the name of an existing file or directory. When the attempt succeeds, the FTP Server runs the external command associated with the conversion. The magic cookie %s in the argument is passed to the command, replaced with the name of the existing file or directory.

External command is the absolute pathname of a command to run followed by the appropriate options to carry out the conversion. The standard output of the command is sent back in response to the RETR (retrieve) command. For anonymous and guest users to be able to execute the command, it must be present in their chroot'd hierarchy along with any necessary dynamic libraries.

Types specifies the conversion type. The following values are recognized:

T_ASCII

ASCII transfers are allowed of a file produced by the conversion.

T_DIR

Directories can be converted.

T_REG

Regular files can be converted.

Options are checked against the ftpaccess(4) compress and tar capabilities and are recorded in the special-action-flag field that is written to the FTP Server logfile. See xferlog(4). The following options are supported:

O_COMPRESS

conversion compresses

O_TAR

conversion archives

O_UNCOMPRESS

conversion uncompresses

You can specify more than one option by using "|" to separate options. For example, O_TAR|O_COMPRESS specifies that the conversion archives and compresses.

Description is a one word description of the conversion that is used in error messages returned to the FTP client.

Lines that begin with a # sign are treated as comment lines and are ignored.

EXAMPLES

Example 1 Compressing a Regular File for Transfer

The following example specifies a conversion which generates filename.Z by compressing an existing file filename. The conversion can only be applied to regular files, not directories, and the absence of T_ASCII prevents the resulting file from being transferred in ASCII mode.

: : :.Z:/usr/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS

Example 2 Uncompressing and Transferring in ASCII Mode

The following example specifies a conversion that takes filename.Z and uncompresses it to produce filename, which then can be transferred in ASCII mode.

:.Z: : :/usr/bin/compress -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
FILES

/etc/ftpd/ftpconversions

SEE ALSO

ldd(1), in.ftpd(1M), ftpaccess(4), xferlog(4), attributes(5)