ftpconversions(4tcp)


ftpconversions -- ftpd conversions database

Description

The conversions known by ftpd(1Mtcp) and their attributes are stored in an ASCII file that is structured as follows:

strpre:strpos:addpre:addpos:extcom:types:options:desc

Each line in the file provides a description for a single conversion. The colon-separated fields have the following meanings:


strpre
strip prefix

strpos
strip postfix

addpre
addon prefix

addpos
addon postfix

extcom
external command

types
types

options
options

desc
description

Prefix and postfix

The prefix fields are not currently supported. The postfix fields define extensions to be added or removed from user-specified filenames. The addon postfix field is assumed to have been appended to a real filename and is removed prior to looking up the file. The strip postfix field is appended to the user-supplied filename before looking up the file.

The filename that results is available for use in the external command field by using the magic cookie ``%s''.

External command

The external command must be specified using an absolute pathname. For anonymous users to be able to execute the command, it must be present in the home directory hierarchy of the anonymous user.

Types

The following types are defined:

T_ASCII
allow ASCII transfer of a file resulting from a conversion

T_DIR
allow directories to be converted

T_REG
allow regular files to be converted
These types may be used prevent the transfer of compressed files in ASCII mode or attempts to compress directories.

More than one type may be specified by separating them with the ``|'' character.

Options

The following built-in options are known to the FTP server and will cause special information to be displayed in the FTP server log file (see xferlog(4tcp)) if transfers are being logged. These are:

O_COMPRESS
file was compressed during transfer

O_TAR
file was tar'ed during transfer

O_UNCOMPRESS
file was uncompressed during transfer
More than one option may be specified by using the ``|'' character to separate the options.

Examples

The following example shows a conversion that causes files whose names end in .tar to have their suffix removed. The resulting filename is used as an argument to the tar(1) command. The transfer is not allowed to be performed in ASCII mode (T_ASCII is not specified) and a special ``TAR'' flag will be written to the transfer log.
    :  :  :.tar:/usr/bin/tar -cf - %s:T_REG|T_DIR:O_TAR:TAR
Operations other than archival and compression are possible. The next example shows a conversion that causes the contents of a file whose name ends with the extension .txt to be converted from code set 88591 to PC850. This produces a file with the same name but with the extension .850 instead of .txt. Note that this transfer is also not allowed to be performed in ASCII mode.
    :.txt: :.850:/usr/bin/iconv -f 88591 -t PC850 %s:T_REG:O_COMPRESS:ICONV

Files

/etc/ftpconversions

References

ftpaccess(4tcp), ftpd(1Mtcp), xferlog(4tcp)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004