rmt - remote magnetic tape protocol server
This is the description of the enhanced Schily version of the rmt remote tape server program. rmt is a program used by programs like star and ufsdump that like to access remote magnetic tape drives and files through an interprocess communication connection. rmt is normally started up with an rexec(3) or rcmd(3) call.
Any other command causes rmt to exit.
The rmt program accepts open, close, read, write and seek requests as well as requests that are specific to magnetic tapes. rmt performs the commands and then responds with a status indication.
This version of the rmt server gives full compatibility to the original BSD version, the enhanced Sun version and the enhanced GNU version. In addition to the Sun and GNU enhancements, it implements further abstractions for better cross platform compliance. It supports best speed and best compliance even when server and client code are running on different platforms. It is prepared to be installed as a user shell in the passwd file to create remote tape specific logins and security checking. To use the enhanced compatibility features, you need to either use the remote tape client code from star which is available in librmt or reimplement its features.
All responses are send back in ASCII. They are in one of the following two forms.
Successful commands have responses of
|where number is the ASCII representation of a decimal number that usually is the return code of the corresponding system call. Unsuccessful commands are responded to with|
|where error-number is one of the possible error numbers described in intro(2), and error-message is the corresponding error string as retrieved by strerror(3). Note that the error number is valid on the remote system where the rmt code runs and may have a different meaning on the local system.|
|The protocol implements the following commands:|
|The file /etc/default/rmt allows to set up rules to limit the accessibility of files based on rules. This feature is typically used when the rmt run from a non personal but task specific login.
Default values can be set for the following options in /etc/default/rmt. For example:
ACCESS=tape myhost.mydomain.org /dev/rmt/*
All keywords must be on the beginning of a line.
All responses are send to the network connection. They use the form described above.
To use rmt as a remote file access protocol you need to use the symbolic open modes as e.g. the O_CREAT flag is not unique between different architectures.
In order to allow this implementation to be used as a remote file access protocol, it accepts file names up to 4096 bytes with the open command. Other rmt implementations allow no more than 64 bytes.
The possibility to create a debug file by calling rmtfile has been disabled for security reasons. If you like to debug rmt edit /etc/default/rmt and insert a DEBUG entry.
This implementation of rmt adds some security features to the server that make it behave slightly different from older implementations. Read the above documentation about the file /etc/default/rmt to make sure your local installation is configured for your needs.
To grant the same permissions as with old rmt servers, create a file /etc/default/rmt and add the following lines to this file:
ACCESS=* * *
ACCESS=* * *
Note that the three fields in the ACCESS= line need to be separated by a TAB character.
Be very careful when designing patterns to match path names that may be accepted for open. If a pattern would allow to include /../ in the path, a possible intruder could virtually access any path on your system. For this reason, /../ is not allowed to appear in a path regardless of the pattern.
The rmt command first appeared on BSD in march 1981. This rmt server is a new implementation that tries to be compatible to all existing implementations. It is the only known implementation that in addition tries to fix the data exchange problems between different architectures.
This rmt implementation has been written in 1994 by J..org Schilling. In 2000, support for RMT VERSION 1 has been added and a mapping to work around the non-standard Linux mtio opcodes in the range 0..7 has been added. rmt is still maintained by J..org Schilling.