|
|||||||||||
|
user/3324: bug in multi-volume restores
From: Rodger Allen <zebedee.wa(at)bigpond.com>
Date: Wed Jun 18 2003 - 21:22:05 EDT
System : OpenBSD 3.3 Architecture: OpenBSD.i386 Machine : i386dump, restore prompts for the filename, but then does not strip the trainling '\n' from the input. This filename + '\n' is not able to be opened, and restore goes into a loop of prompting and failing. I have only tested this with "real" files on the filesystem, and haven't traced whether it affects restore from rmt or a tape device. My guess is that anyone who has done a restore from a tape device just changes the tape at this point and keeps the filename as-is. >How-To-Repeat:
Create a multi-volume dump (add as many filenames as are necessary): # dump -0 -B 10000 -f 1.dump,2.dump / Restore (starting with the first volume):
# cd /newfs
>Fix:
Apply the patch (or something akin), which removes the trailing '\n' from the next filename input. A workaround is to link to a "mock-tape" file the first dump volume, and then recreate the softlink for each of the other volumes in turn when they are called for by restore, ie, change the mock-tape. Index: tape.c RCS file: /cvs/src/sbin/restore/tape.c,v retrieving revision 1.22 diff -u -r1.22 tape.c
--- tape.c 2003/03/13 05:00:44 1.22
+++ tape.c 2003/06/02 00:45:51
@@ -346,9 +346,12 @@
terminateinput();
return;
}
- if (buf[0] != '\n')
+ if (buf[0] != '\n') {
+ int n = strlen(buf);
+ if (n > 0 && buf[n-1] == '\n')
+ buf[--n] = '\0';
(void)strlcpy(magtape, buf, sizeof magtape);
-
+ }
#ifdef RRESTORE
if (host)
mt = rmtopen(magtape, 0);
# vi:et ai ts=4 textwidth=72 >Release-Note:
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:58 EDT |
||||||||||
|
|||||||||||