1 --- cpio-2.4.2/copyin.c.debian Tue Jun 26 13:51:18 2001
2 +++ cpio-2.4.2/copyin.c Tue Jun 26 13:55:21 2001
7 +/* Debian hack to fix a bug in the --sparse option. This bug has been
8 + reported to "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */
9 +extern int delayed_seek_count;
11 static void read_pattern_file ();
12 static void tape_skip_padding ();
13 static void defer_copyin ();
20 - non_abs_name = (char *) xmalloc (strlen (p) + 1);
21 - strcpy (non_abs_name, p);
22 - free (file_hdr.c_name);
23 - file_hdr.c_name = non_abs_name;
24 + /* Debian hack: file_hrd.c_name is sometimes set to
25 + point to static memory by code in tar.c. This
26 + causes a segfault. Therefore, memmove is used
27 + instead of freeing and reallocating. (Reported by
28 + Horst Knobloch.) This bug has been reported to
29 + "bug-gnu-utils@prep.ai.mit.edu". (99/1/6) -BEM */
30 + (void)memmove (file_hdr.c_name, p, (size_t)(strlen (p) + 1));
35 long_format (&file_hdr, (char *) 0);
38 - printf ("%s\n", file_hdr.c_name);
39 + /* Debian hack: Modified to print a list of filenames
40 + terminiated by a null character when the -t and -0
41 + flags are used. This has been submitted as a
42 + suggestion to "bug-gnu-utils@prep.ai.mit.edu". -BEM */
43 + printf ("%s%c", file_hdr.c_name, name_end);
46 tape_toss_input (in_file_des, file_hdr.c_filesize);
48 if (crc != file_hdr.c_chksum)
49 error (0, 0, "%s: checksum error (0x%x, should be 0x%x)",
50 file_hdr.c_name, crc, file_hdr.c_chksum);
51 + /* Debian hack: -v and -V now work with --only-verify-crc.
54 + fprintf (stderr, "%s\n", file_hdr.c_name);
56 + fputc ('.', stderr);
64 - file_hdr.c_name = xstrdup (new_name.ds_string);
65 + /* Debian hack: file_hrd.c_name is sometimes set to
66 + point to static memory by code in tar.c. This
67 + causes a segfault. This has been fixed and an
68 + additional check to ensure that the file name
69 + is not too long has been added. (Reported by
70 + Horst Knobloch.) This bug has been reported to
71 + "bug-gnu-utils@prep.ai.mit.edu". (99/1/6) -BEM */
73 + if (archive_format != arf_tar && archive_format != arf_ustar)
75 + free (file_hdr.c_name);
76 + file_hdr.c_name = xstrdup (new_name.ds_string);
80 + if (is_tar_filename_too_long (new_name.ds_string))
81 + error (0, 0, "%s: file name too long",
82 + new_name.ds_string);
84 + strcpy (file_hdr.c_name, new_name.ds_string);
89 /* See if the file already exists. */
91 but GNU cpio version 2.0-2.2 didn't do that, so we
92 still have to check for links here (and also in case
93 the archive was created and later appeneded to). */
94 + /* Debian hack: (97/1/2) This was reported by Ronald
95 + F. Guilmette to the upstream maintainers. -BEM */
96 link_res = link_to_maj_min_ino (file_hdr.c_name,
97 - file_hdr.c_dev_maj, file_hdr.c_dev_maj,
98 + file_hdr.c_dev_maj, file_hdr.c_dev_min,
103 && archive_format != arf_ustar)
106 + /* Debian hack: (97/1/2) This was reported by Ronald
107 + F. Guilmette to the upstream maintainers. -BEM */
108 link_res = link_to_maj_min_ino (file_hdr.c_name,
109 - file_hdr.c_dev_maj, file_hdr.c_dev_maj,
110 + file_hdr.c_dev_maj, file_hdr.c_dev_min,
116 copy_files_tape_to_disk (in_file_des, out_file_des, file_hdr.c_filesize);
117 disk_empty_output_buffer (out_file_des);
118 + /* Debian hack to fix a bug in the --sparse option.
119 + This bug has been reported to
120 + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */
121 + if (delayed_seek_count > 0)
123 + lseek (out_file_des, delayed_seek_count-1, SEEK_CUR);
124 + write (out_file_des, "", 1);
125 + delayed_seek_count = 0;
127 if (close (out_file_des) < 0)
128 error (0, errno, "%s", file_hdr.c_name);
131 && archive_format != arf_ustar)
134 + /* Debian hack: This was reported by Horst
135 + Knobloch. This bug has been reported to
136 + "bug-gnu-utils@prep.ai.mit.edu". (99/1/6) -BEM */
137 link_res = link_to_maj_min_ino (file_hdr.c_name,
138 - file_hdr.c_dev_maj, file_hdr.c_dev_maj,
139 + file_hdr.c_dev_maj, file_hdr.c_dev_min,
143 @@ -1305,7 +1357,7 @@
144 for (d = deferments; d != NULL; d = d->next)
146 link_res = link_to_maj_min_ino (d->header.c_name,
147 - d->header.c_dev_maj, d->header.c_dev_maj,
148 + d->header.c_dev_maj, d->header.c_dev_min,
152 --- cpio-2.4.2/copyout.c.debian Tue Jun 26 13:51:18 2001
153 +++ cpio-2.4.2/copyout.c Tue Jun 26 13:57:04 2001
155 static void writeout_other_defers ();
156 static void writeout_final_defers();
157 static void writeout_defered_file ();
158 +static void check_for_changed_file ();
160 /* Write out header FILE_HDR, including the file name, to file
161 descriptor OUT_DES. */
162 @@ -112,11 +113,11 @@
163 error (0, 0, "%s: truncating inode number", file_hdr->c_name);
165 sprintf (ascii_header,
166 - "%06o%06o%06lo%06lo%06lo%06lo%06lo%06o%011lo%06lo%011lo",
167 - file_hdr->c_magic & 0xFFFF, (int)(dev & 0xFFFF),
168 + "%06ho%06lo%06lo%06lo%06lo%06lo%06lo%06o%011lo%06lo%011lo",
169 + file_hdr->c_magic & 0xFFFF, (long)(dev & 0xFFFF),
170 file_hdr->c_ino & 0xFFFF, file_hdr->c_mode & 0xFFFF,
171 file_hdr->c_uid & 0xFFFF, file_hdr->c_gid & 0xFFFF,
172 - file_hdr->c_nlink & 0xFFFF, (int)(rdev & 0xFFFF),
173 + file_hdr->c_nlink & 0xFFFF, (long)(rdev & 0xFFFF),
174 file_hdr->c_mtime, file_hdr->c_namesize & 0xFFFF,
175 file_hdr->c_filesize);
176 tape_buffered_write (ascii_header, out_des, 76L);
179 write_out_header (&file_hdr, out_file_des);
180 copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, input_name.ds_string);
181 + check_for_changed_file(input_name.ds_string, &file_hdr);
184 if (archive_format == arf_tar || archive_format == arf_ustar)
187 times.actime = file_stat.st_atime;
188 times.modtime = file_stat.st_mtime;
189 - if (utime (file_hdr.c_name, ×) < 0)
190 + /* Debian hack: Silently ignore EROFS because
191 + reading the file won't have upset its timestamp
192 + if it's on a read-only filesystem. This has been
193 + submitted as a suggestion to
194 + "bug-gnu-utils@prep.ai.mit.edu". -BEM */
195 + if (utime (file_hdr.c_name, ×) < 0
197 error (0, errno, "%s", file_hdr.c_name);
201 error (1, errno, "cannot read checksum for %s", file_name);
204 + if (bytes_left < bytes_read)
205 + bytes_read = bytes_left;
206 for (i = 0; i < bytes_read; ++i)
207 crc += buf[i] & 0xff;
211 write_out_header (&file_hdr, out_file_des);
212 copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, header->c_name);
213 + check_for_changed_file(header->c_name, &file_hdr);
216 if (archive_format == arf_tar || archive_format == arf_ustar)
219 times.actime = file_hdr.c_mtime;
220 times.modtime = file_hdr.c_mtime;
221 - if (utime (file_hdr.c_name, ×) < 0)
222 + /* Debian hack: Silently ignore EROFS because reading the file
223 + won't have upset its timestamp if it's on a read-only
224 + filesystem. This has been submitted as a suggestion to
225 + "bug-gnu-utils@prep.ai.mit.edu". -BEM */
226 + if (utime (file_hdr.c_name, ×) < 0
228 error (0, errno, "%s", file_hdr.c_name);
234 +check_for_changed_file (name, header)
236 + struct new_cpio_header *header;
238 + struct stat new_file_stat;
240 + if ((*xstat) (name, &new_file_stat) < 0)
242 + error (0, errno, "%s", name);
245 + if (header->c_filesize != new_file_stat.st_size)
246 + error (0, 0, "%s: size changed from %ld to %ld during copy-out",
247 + name, header->c_filesize, new_file_stat.st_size);
248 + if (header->c_mtime != new_file_stat.st_mtime)
249 + error (0, 0, "%s: mtime changed during copy-out",
250 + name, header->c_filesize, new_file_stat.st_size);
252 --- cpio-2.4.2/copypass.c.debian Tue Jun 26 13:51:18 2001
253 +++ cpio-2.4.2/copypass.c Tue Jun 26 13:51:18 2001
258 +/* Debian hack to fix a bug in the --sparse option. This bug has been
259 + reported to "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */
260 +extern int delayed_seek_count;
262 /* Copy files listed on the standard input into directory `directory_name'.
263 If `link_flag', link instead of copying. */
267 copy_files_disk_to_disk (in_file_des, out_file_des, in_file_stat.st_size, input_name.ds_string);
268 disk_empty_output_buffer (out_file_des);
269 + /* Debian hack to fix a bug in the --sparse option.
270 + This bug has been reported to
271 + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */
272 + if (delayed_seek_count > 0)
274 + lseek (out_file_des, delayed_seek_count-1, SEEK_CUR);
275 + write (out_file_des, "", 1);
276 + delayed_seek_count = 0;
278 if (close (in_file_des) < 0)
279 error (0, errno, "%s", input_name.ds_string);
280 if (close (out_file_des) < 0)
283 times.actime = in_file_stat.st_atime;
284 times.modtime = in_file_stat.st_mtime;
285 - if (utime (input_name.ds_string, ×) < 0)
286 + /* Debian hack: Silently ignore EROFS because
287 + reading the file won't have upset its timestamp
288 + if it's on a read-only filesystem. This has been
289 + submitted as a suggestion to
290 + "bug-gnu-utils@prep.ai.mit.edu". -BEM */
291 + if (utime (input_name.ds_string, ×) < 0
293 error (0, errno, "%s", input_name.ds_string);
294 - if (utime (output_name.ds_string, ×) < 0)
295 + if (utime (output_name.ds_string, ×) < 0
297 error (0, errno, "%s", output_name.ds_string);
299 if (retain_time_flag)
300 --- cpio-2.4.2/global.c.debian Wed Nov 30 23:48:12 1994
301 +++ cpio-2.4.2/global.c Tue Jun 26 13:51:18 2001
303 /* Name of file containing the archive, if known; NULL if stdin/out. */
304 char *archive_name = NULL;
306 +/* Name of the remote shell command, if known; NULL otherwise. */
307 +char *rsh_command_option = NULL;
312 --- cpio-2.4.2/main.c.debian Tue Jun 26 13:51:18 2001
313 +++ cpio-2.4.2/main.c Tue Jun 26 13:51:18 2001
315 {"preserve-modification-time", 0, &retain_time_flag, TRUE},
316 {"rename", 0, &rename_flag, TRUE},
317 {"rename-batch-file", 1, 0, 137},
318 + {"rsh-command", 1, 0, 140},
319 {"quiet", 0, 0, 138},
320 {"sparse", 0, 0, 135},
323 [--file=[[user@]host:]archive] [--format=format] [--message=message]\n\
324 [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n\
325 [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n\
326 - [--force-local] [--help] [--version] < name-list [> archive]\n", program_name);
327 + [--force-local] [--rsh-command=command] [--help] [--version] < name-list\n\
328 + [> archive]\n", program_name);
330 %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H format]\n\
331 [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n\
333 [--io-size=bytes] [--pattern-file=file] [--format=format]\n\
334 [--owner=[user][:.][group]] [--no-preserve-owner] [--message=message]\n\
335 [--force-local] [--no-absolute-filenames] [--sparse] [--only-verify-crc]\n\
336 - [--quiet] [--help] [--version] [pattern...] [< archive]\n",
337 + [--quiet] [--rsh-command=command] [--help] [--version] [pattern...]\n\
341 %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n\
346 + rsh_command_option = getenv("CPIO_RSH");
349 while ((c = getopt_long (argc, argv,
351 copy_function = process_copy_pass;
355 + rsh_command_option = optarg;
358 case 'r': /* Interactively rename. */
365 - if ((!table_flag || !verbose_flag) && numeric_uid)
367 + /* Debian hack: This version of cpio uses the -n flag also to extract
368 + tar archives using the numeric UID/GID instead of the user/group
369 + names in /etc/passwd and /etc/groups. (98/10/15) -BEM */
371 /* Work around for pcc bug. */
372 copy_in = process_copy_in;
376 if (link_flag || reset_time_flag || xstat != lstat || append_flag
378 + /* Debian hack: The sparse option is used with copy-in not
379 + copy-out. This bug has been reported to
380 + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */
381 || output_archive_name
382 || (archive_name && input_archive_name))
385 || set_group_flag || swap_bytes_flag || swap_halfwords_flag
386 || (append_flag && !(archive_name || output_archive_name))
387 || rename_batch_file || no_abs_paths_flag
388 + /* Debian hack: The sparse option is used with copy-in not
389 + copy-out. This bug has been reported to
390 + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */
392 || input_archive_name || (archive_name && output_archive_name))
394 if (archive_format == arf_unknown)
395 --- cpio-2.4.2/tar.c.debian Fri Feb 25 20:25:33 1994
396 +++ cpio-2.4.2/tar.c Tue Jun 26 13:51:18 2001
397 @@ -261,15 +261,18 @@
398 file_hdr->c_nlink = 1;
399 otoa (tar_hdr->mode, &file_hdr->c_mode);
400 file_hdr->c_mode = file_hdr->c_mode & 07777;
401 + /* Debian hack: This version of cpio uses the -n flag also to extract
402 + tar archives using the numeric UID/GID instead of the user/group
403 + names in /etc/passwd and /etc/groups. (98/10/15) -BEM */
405 - if (archive_format == arf_ustar
406 + if (archive_format == arf_ustar && !numeric_uid
407 && (uidp = getuidbyname (tar_hdr->uname)))
408 file_hdr->c_uid = *uidp;
411 otoa (tar_hdr->uid, &file_hdr->c_uid);
413 - if (archive_format == arf_ustar
414 + if (archive_format == arf_ustar && !numeric_uid
415 && (gidp = getgidbyname (tar_hdr->gname)))
416 file_hdr->c_gid = *gidp;
418 --- cpio-2.4.2/util.c.debian Tue Jan 16 22:40:14 1996
419 +++ cpio-2.4.2/util.c Tue Jun 26 13:51:18 2001
421 while (num_bytes > 0)
424 - if (rc = disk_fill_input_buffer (in_des, DISK_IO_BLOCK_SIZE))
425 + if (rc = disk_fill_input_buffer (in_des,
426 + num_bytes < DISK_IO_BLOCK_SIZE ?
427 + num_bytes : DISK_IO_BLOCK_SIZE))
430 error (0, 0, "File %s shrunk by %ld bytes, padding with zeros",
431 @@ -808,13 +810,14 @@
432 copy_in = process_copy_in;
434 if (copy_function == copy_in)
435 - fd = rmtopen (file, O_RDONLY | O_BINARY, 0666);
436 + fd = rmtopen (file, O_RDONLY | O_BINARY, 0666, rsh_command_option);
440 - fd = rmtopen (file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
441 + fd = rmtopen (file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666,
442 + rsh_command_option);
444 - fd = rmtopen (file, O_RDWR | O_BINARY, 0666);
445 + fd = rmtopen (file, O_RDWR | O_BINARY, 0666, rsh_command_option);
449 --- cpio-2.4.2/rtapelib.c.debian Wed Nov 30 23:59:40 1994
450 +++ cpio-2.4.2/rtapelib.c Tue Jun 26 13:51:18 2001
451 @@ -264,11 +264,12 @@
452 On error, return -1. */
455 -__rmt_open (path, oflag, mode, bias)
456 +__rmt_open (path, oflag, mode, bias, remote_shell)
461 + const char *remote_shell;
464 char buffer[CMDBUFSIZE]; /* Command buffer. */
465 @@ -372,29 +373,43 @@
469 - execl ("/usr/ucb/rsh", "rsh", system, "-l", login,
470 + /* Debian hack: added remote shell command line option.
472 + if (remote_shell) {
473 + const char *remote_shell_basename;
474 + remote_shell_basename = strrchr (remote_shell, '/');
475 + if (remote_shell_basename)
476 + remote_shell_basename++;
478 + remote_shell_basename = remote_shell;
479 + execl (remote_shell, remote_shell_basename, system, "-l", login,
480 "/etc/rmt", (char *) 0);
481 - execl ("/usr/bin/remsh", "remsh", system, "-l", login,
483 + execl ("/usr/bin/ssh", "ssh", system, "-l", login,
484 "/etc/rmt", (char *) 0);
485 execl ("/usr/bin/rsh", "rsh", system, "-l", login,
486 "/etc/rmt", (char *) 0);
487 - execl ("/usr/bsd/rsh", "rsh", system, "-l", login,
488 - "/etc/rmt", (char *) 0);
489 - execl ("/usr/bin/nsh", "nsh", system, "-l", login,
490 - "/etc/rmt", (char *) 0);
495 - execl ("/usr/ucb/rsh", "rsh", system,
496 + /* Debian hack: added remote shell command line option.
498 + if (remote_shell) {
499 + const char *remote_shell_basename;
500 + remote_shell_basename = strrchr (remote_shell, '/');
501 + if (remote_shell_basename)
502 + remote_shell_basename++;
504 + remote_shell_basename = remote_shell;
505 + execl (remote_shell, remote_shell_basename, system,
506 "/etc/rmt", (char *) 0);
507 - execl ("/usr/bin/remsh", "remsh", system,
509 + execl ("/usr/bin/ssh", "ssh", system,
510 "/etc/rmt", (char *) 0);
511 execl ("/usr/bin/rsh", "rsh", system,
512 "/etc/rmt", (char *) 0);
513 - execl ("/usr/bsd/rsh", "rsh", system,
514 - "/etc/rmt", (char *) 0);
515 - execl ("/usr/bin/nsh", "nsh", system,
516 - "/etc/rmt", (char *) 0);
520 /* Bad problems if we get here. */
521 --- cpio-2.4.2/extern.h.debian Tue Jun 26 13:51:18 2001
522 +++ cpio-2.4.2/extern.h Tue Jun 26 13:51:18 2001
524 extern char *new_media_message_after_number;
525 extern int archive_des;
526 extern char *archive_name;
527 +extern char *rsh_command_option;
528 extern unsigned long crc;
530 extern int debug_flag;
531 --- cpio-2.4.2/rmt.h.debian Thu Dec 1 00:00:32 1994
532 +++ cpio-2.4.2/rmt.h Tue Jun 26 13:51:18 2001
534 /* Definitions for communicating with a remote tape drive.
535 - Copyright (C) 1988, 1992 Free Software Foundation, Inc.
536 +Copyright (C) 1988, 1992 Free Software Foundation, Inc.
538 - This program is free software; you can redistribute it and/or modify
539 - it under the terms of the GNU General Public License as published by
540 - the Free Software Foundation; either version 2, or (at your option)
543 - This program is distributed in the hope that it will be useful,
544 - but WITHOUT ANY WARRANTY; without even the implied warranty of
545 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
546 - GNU General Public License for more details.
548 - You should have received a copy of the GNU General Public License
549 - along with this program; if not, write to the Free Software
550 - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
551 +This program is free software; you can redistribute it and/or modify
552 +it under the terms of the GNU General Public License as published by
553 +the Free Software Foundation; either version 2, or (at your option)
556 +This program is distributed in the hope that it will be useful,
557 +but WITHOUT ANY WARRANTY; without even the implied warranty of
558 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
559 +GNU General Public License for more details.
561 +You should have received a copy of the GNU General Public License
562 +along with this program; if not, write to the Free Software
563 +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
568 #define _remdev(path) (!f_force_local && (__rmt_path=index(path, ':')))
569 #define _isrmt(fd) ((fd) >= __REM_BIAS)
571 -#define rmtopen(path,oflag,mode) (_remdev(path) ? __rmt_open(path, oflag, mode, __REM_BIAS) : open(path, oflag, mode))
572 +#define rmtopen(path,oflag,mode,rsh) (_remdev(path) ? __rmt_open(path, oflag, mode, __REM_BIAS,rsh) : open(path, oflag, mode))
573 #define rmtaccess(path, amode) (_remdev(path) ? 0 : access(path, amode))
574 #define rmtstat(path, buf) (_remdev(path) ? (errno = EOPNOTSUPP), -1 : stat(path, buf))
575 -#define rmtcreat(path, mode) (_remdev(path) ? __rmt_open (path, 1 | O_CREAT, mode, __REM_BIAS) : creat(path, mode))
576 +#define rmtcreat(path, mode, rsh) (_remdev(path) ? __rmt_open (path, 1 | O_CREAT, mode, __REM_BIAS, rsh) : creat(path, mode))
577 #define rmtlstat(path,buf) (_remdev(path) ? (errno = EOPNOTSUPP), -1 : lstat(path,buf))
579 #define rmtread(fd, buf, n) (_isrmt(fd) ? __rmt_read(fd - __REM_BIAS, buf, n) : read(fd, buf, n))
580 --- cpio-2.4.2/cpio.1.debian Tue Jun 26 13:51:18 2001
581 +++ cpio-2.4.2/cpio.1 Tue Jun 26 13:51:18 2001
583 [\-\-file=[[user@]host:]archive] [\-\-format=format] [\-\-message=message]
584 [\-\-null] [\-\-reset-access-time] [\-\-verbose] [\-\-dot] [\-\-append]
585 [\-\-block-size=blocks] [\-\-dereference] [\-\-io-size=bytes] [\-\-quiet]
586 -[\-\-force\-local] [\-\-help] [\-\-version] < name-list [> archive]
587 +[\-\-force\-local] [\-\-rsh-command=command] [\-\-help] [\-\-version]
588 +< name-list [> archive]
591 {\-i|\-\-extract} [\-bcdfmnrtsuvBSV] [\-C bytes] [\-E file] [\-H format]
592 [\-M message] [\-R [user][:.][group]] [\-I [[user@]host:]archive]
593 [\-F [[user@]host:]archive] [\-\-file=[[user@]host:]archive]
594 [\-\-make-directories] [\-\-nonmatching] [\-\-preserve-modification-time]
595 -[\-\-numeric-uid-gid] [\-\-rename] [\-\-list] [\-\-swap-bytes] [\-\-swap] [\-\-dot]
596 +[\-\-numeric-uid-gid] [\-\-rename] [\-t|\-\-list] [\-\-swap-bytes] [\-\-swap] [\-\-dot]
597 [\-\-unconditional] [\-\-verbose] [\-\-block-size=blocks] [\-\-swap-halfwords]
598 [\-\-io-size=bytes] [\-\-pattern-file=file] [\-\-format=format]
599 [\-\-owner=[user][:.][group]] [\-\-no-preserve-owner] [\-\-message=message]
600 -[\-\-force\-local] [\-\-no\-absolute\-filenames] [\-\-sparse] [\-\-only\-verify\-crc]
601 -[\-\-quiet] [\-\-help] [\-\-version] [pattern...] [< archive]
602 +[\-\-force\-local] [\-\-no\-absolute\-filenames] [\-\-sparse]
603 +[\-\-only\-verify\-crc] [\-\-quiet] [\-\-rsh-command=command] [\-\-help]
604 +[\-\-version] [pattern...] [< archive]
607 {\-p|\-\-pass-through} [\-0adlmuvLV] [\-R [user][:.][group]]
609 .I "\-n, \-\-numeric-uid-gid"
610 In the verbose table of contents listing, show numeric UID and GID
611 instead of translating them into names.
612 +Also extracts tar archives using the numeric UID and GID instead of the
615 +archives are always extracted using the numeric UID and GID.)
617 .I " \-\-no-absolute-filenames"
618 In copy-in mode, create all files relative to the current directory,
620 separator is given, use the given user's login group. Only the
621 super-user can change files' ownership.
623 +.I "\-\-rsh-command=COMMAND"
626 +that it should use COMMAND to communicate with remote devices instead of
629 +or the command specified by the environment variable
633 -In copy-out and copy-pass modes, write files with large blocks of zeros
634 +In copy-in and copy-pass modes, write files with large blocks of zeros
637 .I "\-s, \-\-swap-bytes"
638 --- cpio-2.4.2/mt.1.debian Wed Nov 22 22:31:50 1995
639 +++ cpio-2.4.2/mt.1 Tue Jun 26 13:51:18 2001
641 mt \- control magnetic tape drive operation
644 -[\-V] [\-f device] [\-\-file=device] [\-\-version]
645 +[\-V] [\-f device] [\-\-file=device] [\-\-rsh-command=command] [\-\-version]
651 Equivalent to rewind followed by fsf
654 -Seek to block number
657 Space to the end of the recorded media on the tape
658 (for appending files onto tapes).
660 then rewind it again.
664 +(SCSI tapes) Forward space
668 +(SCSI tapes) Backward space
674 +setmarks at current position (only SCSI tape).
676 +Space to end of valid data. Used on streamer tape
677 +drives to append data to the logical and of tape.
679 +(SCSI tapes) Set the block size of the drive to
683 +(SCSI tapes) Set the tape density code to
685 +The proper codes to use with each drive should be looked up from the
686 +drive documentation.
688 +(SCSI tapes) Set the tape drive buffer code to
690 +The proper value for unbuffered operation is zero and "normal" buffered
691 +operation one. The meanings of other values can be found in the drive
692 +documentation or, in case of a SCSI-2 drive, from the SCSI-2 standard.
694 +(SCSI tapes) Set the driver options bits to
697 +The bits can be set by oring the following values: 1 to enable write
698 +buffering, 2 to enable asynchronous writes, 4 to enable read ahead,
699 +8 to enable debugging output (if it has been compiled to the driver).
701 +(SCSI tapes) The write threshold for the tape device is set to
703 +kilobytes. The value must be smaller than or equal to the driver
706 +(SCSI tapes) Seek to the
708 +block on the tape. This operation is available on some
709 +Tandberg and Wangtek streamers and some SCSI-2 tape drives.
711 +(SCSI tapes) Tell the current block on tape. This operation is available on some
712 +Tandberg and Wangtek streamers and some SCSI-2 tape drives.
714 +(SCSI tapes) Write explanation of some common density codes to
717 +(some SCSI-2 DAT tapes) Inquire or set the compression status
720 +is one the compression status is printed. If the
722 +is zero, compression is disabled. Otherwise, compression is
723 +enabled. The command uses the SCSI ioctl to read and write the Data
724 +Compression Characteristics mode page (15). ONLY ROOT CAN USE THIS
728 exits with a status of 0 if the operation succeeded, 1 if the
730 you have permission to do so (typically an entry in that user's
733 +.I "\-\-rsh-command=command"
738 +to communicate with remote devices instead of
741 +or the command specified by the environment variable
744 .I "\-V, \-\-version"
745 Print the version number of
747 --- cpio-2.4.2/configure.debian Wed Dec 20 17:34:04 1995
748 +++ cpio-2.4.2/configure Tue Jun 26 13:51:18 2001
753 # Guess values for system-dependent variables and create Makefiles.
754 # Generated automatically using autoconf version 2.7
755 --- cpio-2.4.2/mt.c.debian Wed Nov 22 22:31:49 1995
756 +++ cpio-2.4.2/mt.c Tue Jun 26 13:51:18 2001
758 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
761 +/* Modified for the Linux SCSI tape driver by Brian Mays from code
762 + written by Kai Makisara.
763 + Last Modified: Tue Apr 23 15:37:54 EDT 1996
766 /* If -f is not given, the environment variable TAPE is used;
767 if that is not set, a default device defined in sys/mtio.h is used.
769 retension Rewind the tape, then wind it to the end of the reel,
770 then rewind it again.
771 erase Erase the tape.
772 + fss (SCSI tapes) Forward space COUNT setmarks.
773 + bss (SCSI tapes) Backward space COUNT setmarks.
774 + wset (SCSI tapes) Write COUNT setmarks at current position
776 + eod, seod Space to end of valid data. Used on streamer tape
777 + drives to append data to the logical and of tape.
778 + setblk (SCSI tapes) Set the block size of the drive to COUNT
780 + setdensity (SCSI tapes) Set the tape density code to COUNT. The
781 + proper codes to use with each drive should be looked
782 + up from the drive documentation.
783 + drvbuffer (SCSI tapes) Set the tape drive buffer code to
784 + NUMBER. The proper value for unbuffered operation is
785 + zero and "normal" buffered operation one. The meanings
786 + of other values can be found in the drive
787 + documentation or, in case of a SCSI-2 drive, from the
789 + stoptions (SCSI tapes) Set the driver options bits to COUNT for
790 + the device. The bits can be set by oring the
791 + following values: 1 to enable write buffering, 2 to
792 + enable asynchronous writes, 4 to enable read ahead, 8
793 + to enable debugging output (if it has been compiled to
796 + (SCSI tapes) The write threshold for the tape device
797 + is set to COUNT kilobytes. The value must be smaller
798 + than or equal to the driver buffer size.
799 + seek (SCSI tapes) Seek to the COUNT block on the tape.
800 + This operation is available on some Tandberg and
801 + Wangtek streamers and some SCSI-2 tape drives.
802 + tell (SCSI tapes) Tell the current block on tape. This
803 + operation is available on some Tandberg and Wangtek
804 + streamers and some SCSI-2 tape drives.
805 + densities (SCSI tapes) Write explanation of some common density
806 + codes to standard output.
808 + (some SCSI-2 DAT tapes) Inquire or set the compression
809 + status (on/off). If the COUNT is one the compression
810 + status is printed. If the COUNT is zero, compression
811 + is disabled. Otherwise, compression is enabled.
813 David MacKenzie <djm@gnu.ai.mit.edu> */
816 void perform_operation ();
817 void print_status ();
820 +void print_position ();
823 +int do_dat_compression(char *dev, int fn, int count);
825 +#if defined(linux) || defined(__linux)
826 +#define MTDATCOMP 1000 /* Random unused number. */
827 +#define MTDENS 1001 /* Random unused number. */
834 + {0x01, "NRZI (800 bpi)"},
835 + {0x02, "PE (1600 bpi)"},
836 + {0x03, "GCR (6250 bpi)"},
837 + {0x05, "QIC-45/60 (GCR, 8000 bpi)"},
838 + {0x06, "PE (3200 bpi)"},
839 + {0x07, "IMFM (6400 bpi)"},
840 + {0x08, "GCR (8000 bpi)"},
841 + {0x09, "GCR (37871 bpi)"},
842 + {0x0a, "MFM (6667 bpi)"},
843 + {0x0b, "PE (1600 bpi)"},
844 + {0x0c, "GCR (12960 bpi)"},
845 + {0x0d, "GCR (25380 bpi)"},
846 + {0x0f, "QIC-120 (GCR 10000 bpi)"},
847 + {0x10, "QIC-150/250 (GCR 10000 bpi)"},
848 + {0x11, "QIC-320/525 (GCR 16000 bpi)"},
849 + {0x12, "QIC-1350 (RLL 51667 bpi)"},
850 + {0x13, "DDS (61000 bpi)"},
851 + {0x14, "EXB-8200 (RLL 43245 bpi)"},
852 + {0x15, "EXB-8500 (RLL 45434 bpi)"},
853 + {0x16, "MFM 10000 bpi"},
854 + {0x17, "MFM 42500 bpi"},
857 + {140, "EXB-8505 compressed"},
858 + {144, "EXB-8205 compressed"},
895 +#ifdef MTSETDRVBUFFER
897 +#ifdef MT_ST_BOOLEANS
900 +#ifdef MT_ST_WRITE_THRESHOLD
944 +#ifdef MTSETDRVBUFFER
946 +#ifdef MT_ST_BOOLEANS
949 +#ifdef MT_ST_WRITE_THRESHOLD
964 +#ifdef MT_ST_BOOLEANS
967 +#ifdef MT_ST_WRITE_THRESHOLD
975 +#ifdef MT_ST_BOOLEANS
978 +#ifdef MT_ST_WRITE_THRESHOLD
979 + MT_ST_WRITE_THRESHOLD,
985 + struct mt_tape_info tapes[] = MT_TAPE_INFO;
988 /* If nonzero, don't consider file names that contain a `:' to be
989 on remote hosts; all files are local. Always zero for mt;
990 since when do local device names contain colons? */
992 struct option longopts[] =
994 {"file", 1, NULL, 'f'},
995 + {"rsh-command", 1, NULL, 1},
996 {"version", 0, NULL, 'V'},
997 {"help", 0, NULL, 'H'},
999 @@ -178,12 +361,15 @@
1003 + char *rsh_command_option = getenv("MT_RSH");
1005 program_name = argv[0];
1009 - while ((i = getopt_long (argc, argv, "f:t:V:H", longopts, (int *) 0)) != -1)
1010 + /* Debian hack: Fixed a bug in the -V flag. This bug has been
1011 + reported to "bug-gnu-utils@prep.ai.mit.edu". -BEM */
1012 + while ((i = getopt_long (argc, argv, "f:t:VH", longopts, (int *) 0)) != -1)
1016 @@ -192,6 +378,10 @@
1021 + rsh_command_option = optarg;
1025 printf ("GNU mt %s", version_string);
1027 @@ -214,10 +404,22 @@
1029 operation = operations[i];
1031 + i = argmatch (argv[optind], cbnames);
1033 if (++optind < argc)
1034 + /* Debian hack: Replaced the atoi function call with strtol so
1035 + that hexidecimal values can be used for the count parameter.
1036 + This bug has been reported to "bug-gnu-utils@prep.ai.mit.edu".
1038 +#if defined(STDC_HEADERS)
1039 + count = (int) strtol (argv[optind], NULL, 0);
1041 count = atoi (argv[optind]);
1043 if (++optind < argc)
1046 + count |= count_bits[i];
1048 if (tapedev == NULL)
1050 @@ -230,27 +432,58 @@
1055 + if (operation == MTDENS)
1057 + printf("Some SCSI tape density codes:\ncode explanation\n");
1058 + for (i=0; density_tbl[i].code >= 0; i++)
1059 + printf("0x%02x %s\n", density_tbl[i].code, density_tbl[i].name);
1064 if ( (operation == MTWEOF)
1066 || (operation == MTERASE)
1069 + || (operation == MTWSM)
1071 +#ifdef MTSETDRVBUFFER
1072 + || (operation == MTSETDRVBUFFER)
1075 + || (operation == MTDATCOMP)
1078 - tapedesc = rmtopen (tapedev, O_WRONLY, 0);
1079 + tapedesc = rmtopen (tapedev, O_WRONLY, 0, rsh_command_option);
1081 - tapedesc = rmtopen (tapedev, O_RDONLY, 0);
1082 + tapedesc = rmtopen (tapedev, O_RDONLY, 0, rsh_command_option);
1084 error (1, errno, "%s", tapedev);
1085 check_type (tapedev, tapedesc);
1087 - if (operation == MTASF)
1089 - perform_operation (tapedev, tapedesc, MTREW, 1);
1090 - operation = MTFSF;
1092 - perform_operation (tapedev, tapedesc, operation, count);
1093 - if (operation == MTNOP)
1094 - print_status (tapedev, tapedesc);
1097 + if (operation == MTDATCOMP)
1098 + do_dat_compression(tapedev, tapedesc, count);
1102 + if (operation == MTTELL)
1103 + print_position (tapedev, tapedesc);
1107 + if (operation == MTASF)
1109 + perform_operation (tapedev, tapedesc, MTREW, 1);
1110 + operation = MTFSF;
1112 + perform_operation (tapedev, tapedesc, operation, count);
1113 + if (operation == MTNOP)
1114 + print_status (tapedev, tapedesc);
1117 if (rmtclose (tapedesc) == -1)
1118 error (2, errno, "%s", tapedev);
1120 @@ -283,10 +516,28 @@
1123 control.mt_count = count;
1124 - if (rmtioctl (desc, MTIOCTOP, &control))
1125 + /* Debian hack: The rmtioctl function returns -1 in case of an
1126 + error, not 0. This bug has been reported to
1127 + "bug-gnu-utils@prep.ai.mit.edu". (96/7/10) -BEM */
1128 + if (rmtioctl (desc, MTIOCTOP, &control) == -1)
1129 error (2, errno, "%s", dev);
1134 +print_position (dev, desc)
1138 + struct mtpos position;
1140 + if (rmtioctl (desc, MTIOCPOS, &position) == -1)
1141 + error (2, errno, "%s", dev);
1142 + printf("At block %d.\n", (int) position.mt_blkno);
1148 print_status (dev, desc)
1150 @@ -297,7 +548,35 @@
1151 if (rmtioctl (desc, MTIOCGET, &status))
1152 error (2, errno, "%s", dev);
1154 - printf ("drive type = %d\n", (int) status.mt_type);
1155 +#ifdef MT_ISFTAPE_FLAG
1156 + if ((int) status.mt_type & MT_ISFTAPE_FLAG)
1158 + printf ("qic-117 drive type = 0x%05x, ", (int) status.mt_type & 0x1ffff);
1159 + if (GMT_DR_OPEN( (long) status.mt_gstat))
1161 + printf ("no tape or door open\n");
1165 + printf ("%s-line%s\n",
1166 + GMT_ONLINE( (long) status.mt_gstat) ? "on" : "off",
1167 + GMT_WR_PROT( (long) status.mt_gstat) ?
1168 + " and write-protected" : "");
1174 +#ifdef MT_TAPE_INFO
1175 + struct mt_tape_info *mt;
1176 + for (mt = tapes; mt->t_type; mt++)
1177 + if (mt->t_type == status.mt_type) break;
1178 + if (mt->t_type != 0)
1179 + printf ("drive type = %s\n", mt->t_name);
1182 + printf ("drive type = %d\n", (int) status.mt_type);
1184 #if defined(hpux) || defined(__hpux)
1185 printf ("drive status (high) = %d\n", (int) status.mt_dsreg1);
1186 printf ("drive status (low) = %d\n", (int) status.mt_dsreg2);
1187 @@ -310,6 +589,60 @@
1188 printf ("file number = %d\n", (int) status.mt_fileno);
1189 printf ("block number = %d\n", (int) status.mt_blkno);
1191 +#if defined(linux) || defined(__linux)
1192 + if (status.mt_type == MT_ISSCSI1 ||
1193 + status.mt_type == MT_ISSCSI2)
1197 + dens = (status.mt_dsreg & MT_ST_DENSITY_MASK) >> MT_ST_DENSITY_SHIFT;
1198 + density = "unknown";
1199 + for (i=0; density_tbl[i].code >= 0; i++)
1200 + if (density_tbl[i].code == dens)
1202 + density = density_tbl[i].name;
1205 + printf("Tape block size %d bytes. Density code 0x%x (%s).\n",
1206 + (int)((status.mt_dsreg & MT_ST_BLKSIZE_MASK) >>
1207 + MT_ST_BLKSIZE_SHIFT),
1210 + printf("Soft error count since last status=%d\n",
1211 + (int)(status.mt_erreg & MT_ST_SOFTERR_MASK) >>
1212 + MT_ST_SOFTERR_SHIFT);
1213 + printf("General status bits on (%x):\n", (unsigned)status.mt_gstat);
1214 + if (GMT_EOF(status.mt_gstat))
1216 + if (GMT_BOT(status.mt_gstat))
1218 + if (GMT_EOT(status.mt_gstat))
1220 + if (GMT_SM(status.mt_gstat))
1222 + if (GMT_EOD(status.mt_gstat))
1224 + if (GMT_WR_PROT(status.mt_gstat))
1225 + printf(" WR_PROT");
1226 + if (GMT_ONLINE(status.mt_gstat))
1227 + printf(" ONLINE");
1228 + if (GMT_D_6250(status.mt_gstat))
1229 + printf(" D_6250");
1230 + if (GMT_D_1600(status.mt_gstat))
1231 + printf(" D_1600");
1232 + if (GMT_D_800(status.mt_gstat))
1234 + if (GMT_DR_OPEN(status.mt_gstat))
1235 + printf(" DR_OPEN");
1236 + if (GMT_IM_REP_EN(status.mt_gstat))
1237 + printf(" IM_REP_EN");
1242 + printf("gstat = %0x\n", (unsigned)status.mt_gstat);
1248 @@ -318,7 +651,122 @@
1252 -Usage: %s [-V] [-f device] [--file=device] [--help] [--version] operation [count]\n",
1253 +Usage: %s [-V] [-f device] [--file=device] [--rsh-command=command]\n\
1254 +\t[--help] [--version] operation [count]\n",
1259 +#if defined(linux) || defined(__linux)
1260 +/*** Get and set the DAT compression (Mode Page 15) ***/
1262 +#define MODE_SENSE 0x1a
1263 +#define MODE_SELECT 0x15
1266 +read_mode_page(int fn, int page, int length, unsigned char *buffer,
1270 + unsigned char tmpbuffer[30], *cmd;
1272 + memset(tmpbuffer, 0, 14);
1273 + ip = (int *)&(tmpbuffer[0]);
1275 + *(ip+1) = length + 4;
1277 + cmd = &(tmpbuffer[8]);
1278 + cmd[0] = MODE_SENSE;
1282 + cmd[2] |= 0x40; /* Get changeable parameter mask */
1283 + cmd[4] = length + 4;
1285 + result = ioctl(fn, 1, tmpbuffer);
1287 + fprintf(stderr, "Can't read mode page. Are you sure you are root?\n");
1290 + memcpy(buffer, tmpbuffer + 8, length + 4);
1296 +write_mode_page(int fn, int page, int length, unsigned char *buffer)
1299 + unsigned char tmpbuffer[40], *cmd;
1301 + memset(tmpbuffer, 0, 14);
1302 + ip = (int *)&(tmpbuffer[0]);
1306 + cmd = &(tmpbuffer[8]);
1307 + cmd[0] = MODE_SELECT;
1309 + cmd[4] = length + 4;
1311 + memcpy(tmpbuffer + 14, buffer, length + 4);
1312 + tmpbuffer[14] = 0; /* reserved data length */
1313 + tmpbuffer[18] &= 0x3f; /* reserved bits in page code byte */
1315 + result = ioctl(fn, 1, tmpbuffer);
1317 + fprintf(stderr, "Can't write mode page.\n");
1325 +do_dat_compression(char *dev, int fn, int count)
1328 + unsigned char buffer[30], mask[30];
1330 + if (!read_mode_page(fn, 0x0f, 16, buffer, 0)) {
1331 + error (2, errno, "%s", dev);
1335 + if (read_mode_page(fn, 0x0f, 16, mask, 1))
1336 + if (mask[4+2] & 0x80 == 0)
1337 + fprintf(stderr, "Device does not allow setting this parameter.\n");
1339 + buffer[4+2] &= 0x7f;
1341 + buffer[4+2] |= 0x80;
1342 + if (buffer[4+2+1] & 0x80 == 0) {
1343 + fprintf(stderr, "Warning: Decompression is disabled. Enabling.\n");
1344 + buffer[4+2+1] |= 0x80;
1348 + if (!write_mode_page(fn, 0x0f, 16, buffer)) {
1349 + error (2, errno, "%s", dev);
1351 + if (!read_mode_page(fn, 0x0f, 16, buffer, 0)) { /* Re-read to check */
1352 + error (2, errno, "%s", dev);
1356 + if (buffer[4+2] & 0x80)
1357 + printf("Compression on.\n");
1359 + printf("Compression off.\n");
1360 + if (buffer[4+2] & 0x40)
1361 + printf("Compression capable.\n");
1363 + printf("Compression not capable.\n");
1364 + if (buffer[4+2+1] & 0x80)
1365 + printf("Decompression capable.\n");
1367 + printf("Decompression not capable.\n");
1372 --- cpio-2.4.2/rmt.c.debian Tue Jun 26 13:51:18 2001
1373 +++ cpio-2.4.2/rmt.c Tue Jun 26 13:59:12 2001
1378 -#if defined (_I386) && defined (_AIX)
1379 +/* Debian hack: gcc has exhibited problems loading fcntl.h. Therefore,
1380 + I removed the preprocessor conditionals here - BEM */
1384 #ifdef HAVE_UNISTD_H
1390 -extern char *sys_errlist[];
1391 +extern const char *const _sys_errlist[];
1392 +#if HAVE_STRERROR || _LIBC
1397 +static char *private_strerror(errnum)
1400 + extern char *sys_errlist[];
1401 + extern int sys_nerr;
1402 + if(errnum>0 && errnum<=sys_nerr)
1403 + return sys_errlist[errnum];
1404 + return "Unknown system error";
1406 +#define strerror private_strerror
1412 #define DEBUG1(f,a) if (debug) fprintf(debug, f, a)
1413 #define DEBUG2(f,a1,a2) if (debug) fprintf(debug, f, a1, a2)
1416 + * Support for Sun's extended RMT protocol
1418 +#define RMTI_VERSION -1
1419 +#define RMT_VERSION 1
1421 +/* Extended 'i' commands */
1422 +#define RMTI_CACHE 0
1423 +#define RMTI_NOCACHE 1
1424 +#define RMTI_RETEN 2
1425 +#define RMTI_ERASE 3
1427 +#define RMTI_NBSF 5
1429 +/* Extended 's' comands */
1430 +#define MTS_TYPE 'T'
1431 +#define MTS_DSREG 'D'
1432 +#define MTS_ERREG 'E'
1433 +#define MTS_RESID 'R'
1434 +#define MTS_FILENO 'F'
1435 +#define MTS_BLKNO 'B'
1436 +#define MTS_FLAGS 'f'
1442 @@ -200,7 +240,12 @@
1445 DEBUG2 ("rmtd: I %s %s\n", op, count);
1446 + if (atoi(op) == RMTI_VERSION)
1448 + rval = RMT_VERSION;
1454 mtop.mt_op = atoi (op);
1455 @@ -212,6 +257,58 @@
1464 + getstring (count);
1465 + DEBUG2 ("rmtd: i %s %s\n", op, count);
1470 + mtop.mt_op = MTCACHE;
1474 + case RMTI_NOCACHE:
1475 + mtop.mt_op = MTNOCACHE;
1480 + mtop.mt_op = MTRETEN;
1485 + mtop.mt_op = MTERASE;
1490 + mtop.mt_op = MTEOM;
1495 + mtop.mt_op = MTNBSF;
1503 + mtop.mt_count = atoi (count);
1504 + if (ioctl (tape, MTIOCTOP, (char *) &mtop) < 0)
1506 + rval = mtop.mt_count;
1511 case 'S': /* status */
1512 DEBUG ("rmtd: S\n");
1514 @@ -227,6 +324,59 @@
1521 + struct mtget mtget;
1523 + if (read (0, &s, 1) != 1)
1527 + if (ioctl (tape, MTIOCGET, (char *) &mtget) < 0)
1533 + rval = mtget.mt_type;
1537 + rval = mtget.mt_dsreg;
1541 + rval = mtget.mt_erreg;
1545 + rval = mtget.mt_resid;
1549 + rval = mtget.mt_fileno;
1553 + rval = mtget.mt_blkno;
1557 + rval = mtget.mt_gstat;
1572 DEBUG1 ("rmtd: garbage command %c\n", c);
1574 @@ -289,7 +439,11 @@
1578 - DEBUG2 ("rmtd: E %d (%s)\n", num, sys_errlist[num]);
1579 - (void) sprintf (resp, "E%d\n%s\n", num, sys_errlist[num]);
1580 +/* Debian hack: rmt has problems on systems (such as the Hurd) where
1581 + sys_errlist is not available therefore I borrowed some code from
1582 + error.c to fix this problem. This has been reported to the upstream
1583 + maintainers. (7/22/99) - BEM */
1584 + DEBUG2 ("rmtd: E %d (%s)\n", num, strerror (num));
1585 + (void) sprintf (resp, "E%d\n%s\n", num, strerror (num));
1586 (void) write (1, resp, strlen (resp));
1588 --- cpio-2.4.2/cpio.texi.debian Wed Dec 20 17:29:34 1995
1589 +++ cpio-2.4.2/cpio.texi Tue Jun 26 13:51:18 2001
1590 @@ -257,10 +257,11 @@
1592 cpio @{-o|--create@} [-0acvABLV] [-C bytes] [-H format]
1593 [-M message] [-O [[user@@]host:]archive] [-F [[user@@]host:]archive]
1594 -[--file=[[user@@]host:]archive] [--format=format] [--sparse]
1595 +[--file=[[user@@]host:]archive] [--format=format]
1596 [--message=message][--null] [--reset-access-time] [--verbose]
1597 [--dot] [--append] [--block-size=blocks] [--dereference]
1598 -[--io-size=bytes] [--help] [--version] < name-list [> archive]
1599 +[--io-size=bytes] [--rsh-command=command] [--help] [--version]
1600 +< name-list [> archive]
1603 @node Copy-in mode, Copy-pass mode, Copy-out mode, Invoking `cpio'
1605 [--dot] [--unconditional] [--verbose] [--block-size=blocks]
1606 [--swap-halfwords] [--io-size=bytes] [--pattern-file=file]
1607 [--format=format] [--owner=[user][:.][group]]
1608 -[--no- preserve-owner] [--message=message] [--help] [--version]
1609 -[-no-abosolute-filenames] [-only-verify-crc] [-quiet]
1610 -[pattern...] [< archive]
1611 +[--no-preserve-owner] [--message=message] [--help] [--version]
1612 +[-no-abosolute-filenames] [--sparse] [-only-verify-crc] [-quiet]
1613 +[--rsh-command=command] [pattern...] [< archive]
1616 @node Copy-pass mode, Options, Copy-in mode, Invoking `cpio'
1617 @@ -492,6 +493,10 @@
1618 separator is given, use the given user's login group. Only the
1619 super-user can change files' ownership.
1621 +@item --rsh-command=COMMAND
1622 +Notifies cpio that is should use COMMAND to communicate with remote
1625 @item -s, --swap-bytes
1626 Swap the bytes of each halfword (pair of bytes) in the files.This option
1627 can be used in copy-in mode.
1631 Write files with large blocks of zeros as sparse files. This option is
1632 -used in copy-out and copy-pass modes.
1633 +used in copy-in and copy-pass modes.
1636 Print a table of contents of the input.
1637 --- cpio-2.4.2/rmt.sh.debian Tue Jun 26 13:51:18 2001
1638 +++ cpio-2.4.2/rmt.sh Tue Jun 26 13:51:18 2001
1642 +# This is not a mistake. This shell script (/etc/rmt) has been provided
1643 +# for compatibility with other Unix-like systems, some of which have
1644 +# utilities that expect to find (and execute) rmt in the /etc directory
1645 +# on remote systems.
1648 --- cpio-2.4.2/debian/prerm.debian Tue Jun 26 13:51:18 2001
1649 +++ cpio-2.4.2/debian/prerm Tue Jun 26 13:51:18 2001
1653 +# movedoc - function to make the transition /usr/doc -> /usr/share/doc
1658 + if test -h $OLD; then
1663 +if [ "$1" = remove ]; then
1664 + update-alternatives --remove mt /bin/mt-gnu
1665 + install-info --quiet --remove /usr/info/cpio.info
1666 + if test -L /sbin/rmt -a /sbin/rmt -ef /usr/sbin/rmt; then
1671 --- cpio-2.4.2/debian/changelog.debian Tue Jun 26 13:51:18 2001
1672 +++ cpio-2.4.2/debian/changelog Tue Jun 26 13:51:18 2001
1674 +cpio (2.4.2-36) unstable; urgency=low
1676 + * Fixed error with mt alternatives. (Closes: Bug#84476)
1678 + -- Brian Mays <brian@debian.org> Fri, 2 Feb 2001 15:05:22 -0500
1680 +cpio (2.4.2-35) unstable; urgency=low
1682 + * Renamed gmt to mt-gnu. (Closes: Bug#84118)
1684 + -- Brian Mays <brian@debian.org> Tue, 30 Jan 2001 19:42:28 -0500
1686 +cpio (2.4.2-34) unstable; urgency=low
1688 + * Added an environment variable to cpio and mt to specify the remote
1689 + command. (Closes: Bug#71048)
1690 + * Added compatibility with the mt-st package. (Closes: Bug#83813)
1692 + -- Brian Mays <brian@debian.org> Sun, 28 Jan 2001 16:15:44 -0500
1694 +cpio (2.4.2-33) unstable; urgency=low
1696 + * Added density code 0x22 (SLR4DC) to mt. (Closes: Bug#67424)
1698 + -- Brian Mays <brian@debian.org> Thu, 27 Jul 2000 17:49:56 -0400
1700 +cpio (2.4.2-32) frozen unstable; urgency=low
1702 + * Added patch by Fred Long <flong@sea.com> and Marc SCHAEFER
1703 + <schaefer@alphanet.ch> to fix file corruption when a file changes
1704 + during the backup. (Closes: Bug#53056)
1705 + * Added patch from Anders Hammarquist <iko@dd.chalmers.se> to make
1706 + rmt work with Solaris ufsdump/ufsrestore. (Closes: Bug#58323)
1708 + -- Brian Mays <brian@debian.org> Thu, 17 Feb 2000 12:43:01 -0500
1710 +cpio (2.4.2-31) frozen unstable; urgency=low
1712 + * Fixed missing element from manpage. (Closes: Bug#56904)
1714 + -- Brian Mays <brian@debian.org> Thu, 3 Feb 2000 13:39:55 -0500
1716 +cpio (2.4.2-30) frozen unstable; urgency=low
1718 + * Added build-time dependencies.
1720 + -- Brian Mays <brian@debian.org> Mon, 17 Jan 2000 13:32:18 -0500
1722 +cpio (2.4.2-29) unstable; urgency=low
1724 + * Added patch from Mark Eichin to fix mt's datcompression. (Closes:
1727 + -- Brian Mays <brian@debian.org> Fri, 17 Dec 1999 14:14:40 -0500
1729 +cpio (2.4.2-28) unstable; urgency=low
1731 + * Modified cpio so that the -v and -V flags work with
1732 + --only-verify-crc. (Closes: Bug#49791)
1734 + -- Brian Mays <brian@debian.org> Wed, 10 Nov 1999 08:42:34 -0500
1736 +cpio (2.4.2-27) unstable; urgency=low
1738 + * Fixed FHS /usr/doc -> /usr/share/doc transition scheme.
1740 + -- Brian Mays <brian@debian.org> Fri, 1 Oct 1999 12:43:24 -0400
1742 +cpio (2.4.2-26) unstable; urgency=low
1744 + * Added symbolic link /usr/doc/cpio -> /usr/share/doc/cpio.
1746 + -- Brian Mays <brian@debian.org> Thu, 16 Sep 1999 13:45:04 -0400
1748 +cpio (2.4.2-25) unstable; urgency=low
1750 + * Changed section to "utils".
1751 + * Made /etc/rmt a wrapper script (with comments detailing its purpose)
1752 + instead of a symlink.
1753 + * Removed tar from cpio man page. (Closes: Bug#38043)
1754 + * Moved doc, man, and info to /usr/share as per the FHS.
1755 + * Fixed bug in rmt causing problems on systems (such as the Hurd)
1756 + where sys_errlist is not available. (Closes: Bug#37164)
1758 + -- Brian Mays <brian@debian.org> Thu, 22 Jul 1999 12:04:32 -0400
1760 +cpio (2.4.2-24) unstable; urgency=low
1762 + * Made Debian scripts create and remove the symbolic links to rmt.
1763 + (Closes: Bug#33670)
1765 + -- Brian Mays <brian@debian.org> Mon, 22 Feb 1999 17:24:21 -0500
1767 +cpio (2.4.2-23) frozen unstable; urgency=low
1769 + * Fixed a bug causing cpio to segfault when the tar format is used.
1770 + * Fixed bugs causing cpio to use the wrong minor device numbers.
1772 + -- Brian Mays <brian@debian.org> Wed, 6 Jan 1999 09:59:24 -0500
1774 +cpio (2.4.2-22) unstable frozen; urgency=low
1776 + * Fixed "Lwhence\noffset\n" error in rmt manual page. (Fixes:
1779 + -- Brian Mays <brian@debian.org> Fri, 6 Nov 1998 11:01:57 -0500
1781 +cpio (2.4.2-21) unstable; urgency=low
1783 + * Modified cpio to use the -n flag also to extract tar archives using
1784 + the numeric UID/GID instead of the user/group names in /etc/passwd
1787 + -- Brian Mays <brian@debian.org> Thu, 15 Oct 1998 15:20:34 -0400
1789 +cpio (2.4.2-20) unstable; urgency=low
1791 + * Fixed bug in --sparse feature.
1793 + -- Brian Mays <brian@debian.org> Mon, 5 Oct 1998 12:51:47 -0400
1795 +cpio (2.4.2-19) unstable; urgency=low
1797 + * Added NEWS and README to /usr/doc/cpio. (Fixes: Bug#26338)
1799 + -- Brian Mays <brian@debian.org> Wed, 2 Sep 1998 13:32:18 -0400
1801 +cpio (2.4.2-18) unstable; urgency=low
1803 + * Added patch from Evan Harris to fix mt's datcompression. (Fixes:
1806 + -- Brian Mays <brian@debian.org> Mon, 29 Jun 1998 11:35:57 -0400
1808 +cpio (2.4.2-17) unstable; urgency=low
1810 + * Added patch necessary to build cpio in glibc_2.1. (Provided by
1811 + Juan Cespedes <cespedes@debian.org>.) (Fixes: Bug#22643)
1812 + * Added a --rsh-command command line option (similar to tar's) to
1814 + * Made ssh the default remote command.
1816 + -- Brian Mays <brian@debian.org> Tue, 26 May 1998 13:01:27 -0400
1818 +cpio (2.4.2-16) unstable frozen; urgency=low
1820 + * Fixed problem causing corruption of old style ascii cpio archives.
1821 + Problem caused by a change in the dev_t type used by glibc.
1822 + (Fixes: Bug#22857)
1824 + -- Brian Mays <brian@debian.org> Tue, 26 May 1998 13:01:19 -0400
1826 +cpio (2.4.2-15) frozen unstable; urgency=low
1828 + * Added a patch required for cpio to compile on a PowerPC. Fixes:
1830 + * Removed bashisms from the debian/rules makefile.
1832 + -- Brian Mays <brian@debian.org> Mon, 20 Apr 1998 14:20:36 -0400
1834 +cpio (2.4.2-14) unstable; urgency=low
1836 + * Removed old FSF address from copyright file.
1838 + -- Brian Mays <brian@debian.org> Thu, 12 Feb 1998 17:45:29 -0500
1840 +cpio (2.4.2-13) unstable; urgency=low
1842 + * Changed the function responsible for processing the count parameter
1843 + from atoi() to strtol(). This will allow entries such as 0x24 to be
1846 + -- Brian Mays <brian@debian.org> Fri, 5 Dec 1997 17:21:08 -0500
1848 +cpio (2.4.2-12) unstable; urgency=low
1850 + * Added patch to report more information on FTAPE drives.
1851 + * Made several miscellaneous fixes to source.
1853 + -- Brian Mays <brian@debian.org> Sun, 26 Oct 1997 15:47:59 -0500
1855 +cpio (2.4.2-11) unstable; urgency=low
1859 + -- Brian Mays <brian@debian.org> Tue, 5 Aug 1997 16:53:14 -0400
1861 +cpio (2.4.2-10) unstable; urgency=low
1863 + * Added CR at end of `mt status' output (fixed Bug#7632).
1865 + -- Brian Mays <brian@debian.org> Tue, 25 Feb 1997 12:15:09 -0500
1867 +cpio (2.4.2-9) unstable; urgency=low
1869 + * Fixed a couple of bugs.
1870 + * Moved /usr/doc/cpio/ChangeLog.gz to /usr/doc/cpio/changelog.gz.
1872 + -- Brian Mays <brian@debian.org> Thu, 2 Jan 1997 12:18:39 -0500
1874 +cpio (2.4.2-8) unstable; urgency=low
1876 + * Fixed bug #4427, wrong syscall used to print position of tape.
1878 + -- Brian Mays <brian@debian.org> Thu, 12 Sep 1996 09:55:21 -0400
1880 +cpio (2.4.2-7) unstable; urgency=low
1882 + * New upstream source.
1883 + * Added an rmt manpage (from BSD).
1884 + * First release with the new source format.
1886 + -- Brian Mays <brian@debian.org> Fri, 23 Aug 1996 23:27:40 -0400
1889 +mode: debian-changelog
1891 --- cpio-2.4.2/debian/rules.debian Tue Jun 26 13:51:18 2001
1892 +++ cpio-2.4.2/debian/rules Tue Jun 26 13:51:18 2001
1896 +# debian/rules file - for cpio
1897 +# Copyright 1996-99 by Brian Mays
1898 +# Patterned after the hello package by Ian Jackson.
1904 + ./configure --prefix=/usr/share --exec_prefix=
1908 + $(MAKE) CFLAGS='-O2 -g -Wall' all rmt info
1914 + $(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
1915 + $(RM) config.cache
1916 + $(RM) -r *~ debian/tmp debian/*~ debian/files*
1918 +binary-indep: checkroot build
1921 +binary-arch: checkroot build
1923 + $(RM) -r debian/tmp
1924 + install -d debian/tmp debian/tmp/DEBIAN
1925 + install -d debian/tmp/usr/share/doc/$(package)
1926 +# Install Debian package control information files
1927 + install debian/postinst \
1928 + debian/prerm debian/tmp/DEBIAN/.
1929 +# Install directories
1934 + debian/tmp/usr/sbin \
1935 + debian/tmp/usr/share/man/man1 \
1936 + debian/tmp/usr/share/man/man8 \
1937 + debian/tmp/usr/share/info
1939 + $(MAKE) install prefix=debian/tmp/usr/share exec_prefix=debian/tmp \
1940 + libexecdir=debian/tmp/usr/sbin
1941 + mv debian/tmp/bin/mt debian/tmp/bin/mt-gnu
1942 + mv debian/tmp/usr/share/man/man1/mt.1 \
1943 + debian/tmp/usr/share/man/man1/mt-gnu.1
1945 + strip debian/tmp/bin/*
1946 + strip debian/tmp/usr/sbin/*
1947 +# Install documentation
1948 + install -m 644 ChangeLog debian/tmp/usr/share/doc/$(package)/changelog
1949 + install -m 644 NEWS README debian/tmp/usr/share/doc/$(package)/.
1950 +# Install changelog & copyright
1951 + install -m 644 debian/changelog \
1952 + debian/tmp/usr/share/doc/$(package)/changelog.Debian
1953 + install -m 644 rmt.8 debian/tmp/usr/share/man/man8/.
1954 + install rmt.sh debian/tmp/etc/rmt
1955 + gzip -9v debian/tmp/usr/share/doc/$(package)/*
1956 + gzip -9v debian/tmp/usr/share/man/*/*
1957 + gzip -9v debian/tmp/usr/share/info/*
1958 + install -m 644 debian/copyright debian/tmp/usr/share/doc/$(package)/.
1959 +# Determine shared library dependencies
1960 + dpkg-shlibdeps cpio mt rmt
1961 +# Genereate deb file
1963 + chown -R root.root debian/tmp
1964 + chmod -R g-ws debian/tmp
1965 + dpkg-deb --build debian/tmp ..
1968 + test -f $(package).h -a -f debian/rules
1971 +# Below here is fairly generic really
1973 +binary: binary-indep binary-arch
1976 + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
1980 + test root = "`whoami`"
1982 +.PHONY: binary binary-arch binary-indep clean checkroot
1983 --- cpio-2.4.2/debian/postinst.debian Tue Jun 26 13:51:18 2001
1984 +++ cpio-2.4.2/debian/postinst Tue Jun 26 13:51:18 2001
1988 +# movedoc - function to make the transition /usr/doc -> /usr/share/doc
1993 + NEW=/usr/share/doc/$PKG
1994 + if test -d $OLD -a ! -h $OLD -a ! $OLD -ef $NEW; then
1996 + if test -e $OLD && ! rmdir $OLD 2>/dev/null; then
1997 + VERSION_CONTROL=t \
1998 + cp -ab $OLD $NEW/..
2002 + if test -d /usr/doc -a ! -e $OLD -a -d $NEW; then
2007 +if [ "$1" = configure ]; then
2008 + # Fix some screwup in old package
2010 + 2.4.2-3[45]) update-alternatives --remove mt /bin/gmt; esac
2011 + update-alternatives --install /bin/mt mt /bin/mt-gnu 10 \
2013 + /usr/share/man/man1/mt.1.gz mt.1.gz /usr/share/man/man1/mt-gnu.1.gz
2014 + install-info --quiet \
2015 + --description="A program to manage archives of files." \
2016 + --section "General Commands" "General Commands" /usr/info/cpio.info
2017 + test -f /sbin/rmt || ln -s ../usr/sbin/rmt /sbin/rmt
2020 --- cpio-2.4.2/debian/copyright.debian Tue Jun 26 13:51:18 2001
2021 +++ cpio-2.4.2/debian/copyright Tue Jun 26 13:51:18 2001
2023 +This is the Debian GNU/Linux prepackaged version of GNU cpio
2026 +This package was put together by Ian Murdock <imurdock@debian.org>,
2027 +from sources obtained from:
2028 + prep.ai.mit.edu:/pub/gnu
2030 +This package has been modified by Brian Mays <brian@debian.org>.
2031 +Modifications of cpio package for Debian GNU/Linux Copyright (C) 1996-99
2032 +Brian Mays and are released under the GPL (on Debian systems see
2033 +`/usr/doc/copyright/GPL').
2036 + * added Debian GNU/Linux package maintenance system files
2037 + * moved rmt from /etc to /usr/sbin and installed a symbolic link to
2039 + * split cpio and mt into two separate Debian binary packages
2040 + * fixed 'mt -V' bug
2041 + * modified cpio to print a list of filenames terminated by a null
2042 + character when the -t and -0 flags are used
2043 + * eliminated a spurious error message printed when the -a flag is
2044 + used on a read-only filesystem
2045 + * fixed a remote ioctl bug in mt that caused spurious error messages
2046 + when commands were sent to a remote tape device
2047 + * added SCSI support to mt
2048 + * fixed 'cpio --sparse' bug
2049 + * added an rmt man page (from BSD).
2050 + * fixed a bug that could cause an endless loop
2051 + * fixed a bug that can occur when restoring a whole filesystem
2052 + * fixed problem causing corruption of old style ascii cpio archives
2053 + * fixed a bug that prevents cpio from being compiled with glibc 2.1
2054 + * added an rsh-command option to cpio and mt
2055 + * made ssh the default remote command (instead of rsh)
2056 + * fixed bug causing cpio to segfault when the tar format is used
2057 + * fixed bugs causing cpio to use the wrong minor device numbers
2058 + * fixed bug in rmt causing problems on systems (such as the Hurd)
2059 + where sys_errlist is not available
2060 + * modified cpio so that the -v and -V flags work with
2063 +GNU cpio is Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
2065 + This program is free software; you can redistribute it and/or modify
2066 + it under the terms of the GNU General Public License as published by
2067 + the Free Software Foundation; version 2 dated June, 1991.
2069 + This program is distributed in the hope that it will be useful,
2070 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2071 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2072 + GNU General Public License for more details.
2074 +On Debian GNU/Linux systems, the complete text of the GNU General
2075 +Public License can be found in `/usr/doc/copyright/GPL'.
2077 +rmt.c is Copyright (C) 1983 Regents of the University of California.
2079 + All rights reserved.
2081 + Redistribution and use in source and binary forms are permitted
2082 + provided that the above copyright notice and this paragraph are
2083 + duplicated in all such forms and that any documentation,
2084 + advertising materials, and other materials related to such
2085 + distribution and use acknowledge that the software was developed
2086 + by the University of California, Berkeley. The name of the
2087 + University may not be used to endorse or promote products derived
2088 + from this software without specific prior written permission.
2089 + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
2090 + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
2091 + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2092 --- cpio-2.4.2/debian/control.debian Tue Jun 26 13:51:18 2001
2093 +++ cpio-2.4.2/debian/control Tue Jun 26 13:51:18 2001
2097 +Priority: important
2098 +Maintainer: Brian Mays <brian@debian.org>
2099 +Build-Depends: texinfo
2100 +Standards-Version: 3.2.1.0
2104 +Depends: ${shlibs:Depends}
2106 +Conflicts: mt-st(<<0.6), cpio-mt
2107 +Description: GNU cpio -- a program to manage archives of files.
2108 + GNU cpio is a tool for creating and extracting archives, or copying
2109 + files from one place to another. It handles a number of cpio formats
2110 + as well as reading and writing tar files.
2112 + This package also includes rmt, the remote tape server, and GNU mt, a
2113 + tape drive control program. The mt program is essential for magnetic
2114 + tape drive users. Debian's version of GNU mt supports SCSI tape
2116 --- cpio-2.4.2/debian/substvars.debian Tue Jun 26 13:51:18 2001
2117 +++ cpio-2.4.2/debian/substvars Tue Jun 26 13:51:18 2001
2119 +shlibs:Depends=libc6 (>= 2.1.97)
2120 --- cpio-2.4.2/rmt.8.debian Tue Jun 26 13:51:18 2001
2121 +++ cpio-2.4.2/rmt.8 Tue Jun 26 13:51:18 2001
2123 +.\" Copyright (c) 1983, 1991, 1993
2124 +.\" The Regents of the University of California. All rights reserved.
2126 +.\" Redistribution and use in source and binary forms, with or without
2127 +.\" modification, are permitted provided that the following conditions
2129 +.\" 1. Redistributions of source code must retain the above copyright
2130 +.\" notice, this list of conditions and the following disclaimer.
2131 +.\" 2. Redistributions in binary form must reproduce the above copyright
2132 +.\" notice, this list of conditions and the following disclaimer in the
2133 +.\" documentation and/or other materials provided with the distribution.
2134 +.\" 3. All advertising materials mentioning features or use of this software
2135 +.\" must display the following acknowledgement:
2136 +.\" This product includes software developed by the University of
2137 +.\" California, Berkeley and its contributors.
2138 +.\" 4. Neither the name of the University nor the names of its contributors
2139 +.\" may be used to endorse or promote products derived from this software
2140 +.\" without specific prior written permission.
2142 +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2143 +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2144 +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2145 +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2146 +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2147 +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2148 +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2149 +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2150 +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2151 +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2154 +.\" @(#)rmt.8 8.2 (Berkeley) 12/11/93
2156 +.Dd December 11, 1993
2161 +.Nd remote magtape protocol module
2166 +is a program used by tar, cpio, mt, and the remote dump and restore
2167 +programs in manipulating a magnetic tape drive through an interprocess
2168 +communication connection.
2170 +is normally started up with an
2180 +program accepts requests specific to the manipulation of
2181 +magnetic tapes, performs the commands, then responds with
2182 +a status indication. All responses are in
2186 +Successful commands have responses of:
2187 +.Bd -filled -offset indent
2189 +.Sy A Ar number No \en
2196 +representation of a decimal number.
2197 +Unsuccessful commands are responded to with:
2198 +.Bd -filled -offset indent
2200 +.Xo Sy E Ar error-number
2201 +.No \en Ar error-message
2208 +is one of the possible error
2209 +numbers described in
2213 +is the corresponding error string as printed
2216 +The protocol is comprised of the
2217 +following commands, which are sent as indicated - no spaces are supplied
2218 +between the command and its arguments, or between its arguments, and
2220 +indicates that a newline should be supplied:
2223 +.It Xo Sy \&O Ar device
2224 +.No \en Ar mode No \en
2228 +using the indicated
2231 +is a full pathname and
2235 +representation of a decimal
2236 +number suitable for passing to
2238 +If a device had already been opened, it is
2239 +closed before a new open is performed.
2240 +.It Xo Sy C Ar device No \en
2242 +Close the currently open device. The
2244 +specified is ignored.
2252 +operation using the specified parameters.
2253 +The response value is that returned from the
2257 +.It Sy W Ar count No \en
2259 +Write data onto the open device.
2263 +bytes from the connection, aborting if
2264 +a premature end-of-file is encountered.
2265 +The response value is that returned from
2270 +.It Sy R Ar count No \en
2274 +bytes of data from the open device.
2277 +exceeds the size of the data buffer (10 kilobytes), it is
2278 +truncated to the data buffer size.
2280 +then performs the requested
2284 +.Sy A Ar count-read No \en
2287 +successful; otherwise an error in the
2288 +standard format is returned. If the read
2289 +was successful, the data read is then sent.
2291 +.It Xo Sy I Ar operation
2292 +.No \en Ar count No \en
2298 +command using the specified parameters.
2299 +The parameters are interpreted as the
2301 +representations of the decimal values
2306 +fields of the structure used in the
2308 +call. The return value is the
2310 +parameter when the operation is successful.
2312 +Return the status of the open device, as
2316 +call. If the operation was successful,
2317 +an ``ack'' is sent with the size of the
2318 +status buffer, then the status buffer is
2323 +Any other command causes
2327 +All responses are of the form described above.
2339 +People should be discouraged from using this for a remote
2340 +file access protocol.
2344 +command appeared in