]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/rmt/rmt.8
libarchive: merge security fix from vendor branch
[FreeBSD/FreeBSD.git] / usr.sbin / rmt / rmt.8
1 .\" Copyright (c) 1983, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)rmt.8       8.3 (Berkeley) 6/1/94
29 .\"
30 .Dd June 1, 1994
31 .Dt RMT 8
32 .Os
33 .Sh NAME
34 .Nm rmt
35 .Nd remote magtape protocol module
36 .Sh SYNOPSIS
37 .Nm
38 .Sh DESCRIPTION
39 The
40 .Nm
41 utility is used by the remote dump and restore programs
42 in manipulating a magnetic tape drive through an interprocess
43 communication connection.
44 It is normally started up with an
45 .Xr rcmd 3
46 call.
47 .Pp
48 The
49 .Nm
50 utility accepts requests specific to the manipulation of
51 magnetic tapes, performs the commands, then responds with
52 a status indication.
53 All responses are in
54 .Tn ASCII
55 and in
56 one of two forms.
57 Successful commands have responses of:
58 .Bd -ragged -offset indent
59 .Sm off
60 .Sy A Ar number No \en
61 .Sm on
62 .Ed
63 .Pp
64 .Ar Number
65 is an
66 .Tn ASCII
67 representation of a decimal number.
68 Unsuccessful commands are responded to with:
69 .Bd -ragged -offset indent
70 .Sm off
71 .Xo Sy E Ar error-number
72 .No \en Ar error-message
73 .No \en
74 .Xc
75 .Sm on
76 .Ed
77 .Pp
78 .Ar Error-number
79 is one of the possible error
80 numbers described in
81 .Xr intro 2
82 and
83 .Ar error-message
84 is the corresponding error string as printed
85 from a call to
86 .Xr perror 3 .
87 The protocol is comprised of the
88 following commands, which are sent as indicated - no spaces are supplied
89 between the command and its arguments, or between its arguments, and
90 .Ql \en
91 indicates that a newline should be supplied:
92 .Bl -tag -width Ds
93 .Sm off
94 .It Xo Sy \&O Ar device
95 .No \en Ar mode No \en
96 .Xc
97 .Sm on
98 Open the specified
99 .Ar device
100 using the indicated
101 .Ar mode .
102 .Ar Device
103 is a full pathname and
104 .Ar mode
105 is an
106 .Tn ASCII
107 representation of a decimal
108 number suitable for passing to
109 .Xr open 2 .
110 If a device had already been opened, it is
111 closed before a new open is performed.
112 .Sm off
113 .It Xo Sy C Ar device No \en
114 .Xc
115 .Sm on
116 Close the currently open device.
117 The
118 .Ar device
119 specified is ignored.
120 .Sm off
121 .It Xo Sy L
122 .Ar whence No \en
123 .Ar offset No \en
124 .Xc
125 .Sm on
126 Perform an
127 .Xr lseek 2
128 operation using the specified parameters.
129 The response value is that returned from the
130 .Xr lseek 2
131 call.
132 .Sm off
133 .It Sy W Ar count No \en
134 .Sm on
135 Write data onto the open device.
136 The
137 .Nm
138 utility reads
139 .Ar count
140 bytes from the connection, aborting if
141 a premature end-of-file is encountered.
142 The response value is that returned from
143 the
144 .Xr write 2
145 call.
146 .Sm off
147 .It Sy R Ar count No \en
148 .Sm on
149 Read
150 .Ar count
151 bytes of data from the open device.
152 If
153 .Ar count
154 exceeds the size of the data buffer (10 kilobytes), it is
155 truncated to the data buffer size.
156 The
157 .Nm
158 utility then performs the requested
159 .Xr read 2
160 and responds with
161 .Sm off
162 .Sy A Ar count-read No \en
163 .Sm on
164 if the read was
165 successful; otherwise an error in the
166 standard format is returned.
167 If the read
168 was successful, the data read is then sent.
169 .Sm off
170 .It Xo Sy I Ar operation
171 .No \en Ar count No \en
172 .Xc
173 .Sm on
174 Perform a
175 .Dv MTIOCOP
176 .Xr ioctl 2
177 command using the specified parameters.
178 The parameters are interpreted as the
179 .Tn ASCII
180 representations of the decimal values
181 to place in the
182 .Ar mt_op
183 and
184 .Ar mt_count
185 fields of the structure used in the
186 .Xr ioctl 2
187 call.
188 The return value is the
189 .Ar count
190 parameter when the operation is successful.
191 .It Sy S
192 Return the status of the open device, as
193 obtained with a
194 .Dv MTIOCGET
195 .Xr ioctl 2
196 call.
197 If the operation was successful,
198 an ``ack'' is sent with the size of the
199 status buffer, then the status buffer is
200 sent (in binary).
201 .El
202 .Pp
203 Any other command causes
204 .Nm
205 to exit.
206 .Sh DIAGNOSTICS
207 All responses are of the form described above.
208 .Sh SEE ALSO
209 .Xr rcmd 3 ,
210 .Xr mtio 4 ,
211 .Xr rdump 8 ,
212 .Xr rrestore 8
213 .Sh HISTORY
214 The
215 .Nm
216 utility appeared in
217 .Bx 4.2 .
218 .Sh BUGS
219 People should be discouraged from using this for a remote
220 file access protocol.