]> git.wh0rd.org - dump.git/commitdiff
Fixed the remote tape/file detection in restore.
authorStelian Pop <stelian@popies.net>
Fri, 16 Nov 2001 14:09:07 +0000 (14:09 +0000)
committerStelian Pop <stelian@popies.net>
Fri, 16 Nov 2001 14:09:07 +0000 (14:09 +0000)
CHANGES
restore/main.c
restore/restore.8.in
restore/restore.h
restore/tape.c

diff --git a/CHANGES b/CHANGES
index a3d79529bbc9abefd90cb0e3c0e02fecd04bf76f..7d3142652b5b9685b95ae0e76c3e7424a3de2658 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.142 2001/11/13 12:11:05 stelian Exp $
+$Id: CHANGES,v 1.143 2001/11/16 14:09:07 stelian Exp $
 
 Changes between versions 0.4b24 and 0.4b25 (released ??????????????????)
 ========================================================================
@@ -21,6 +21,14 @@ Changes between versions 0.4b24 and 0.4b25 (released ??????????????????)
         to Clemens Stiglechner <a9401816@unet.univie.ac.at> for the
        patch.
 
+6.     Add the -l option to restore to specify if, when doing a
+        remote restore, the file used to access the backup is a
+       regular file (the defaults being a tape drive). Restore needs
+       to know this information when reading a remote compressed 
+       dump. Previously, this information was autodetected, but
+       the autodetection code fails (with ioctl: Inappropriate ioctl 
+       for device) when using a non Linux remote box.
+       
 Changes between versions 0.4b23 and 0.4b24 (released September 12, 2001)
 ========================================================================
 
index ad0496816a68d42e5265ced41c83751ec56e4b02..8862d0da03d1b7dc4239a608312a874fd666302c 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.31 2001/11/13 12:11:42 stelian Exp $";
+       "$Id: main.c,v 1.32 2001/11/16 14:09:07 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -82,7 +82,7 @@ static const char rcsid[] =
 
 int    bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0;
 int    hflag = 1, mflag = 1, Mflag = 0, Nflag = 0, Vflag = 0, zflag = 0;
-int    uflag = 0;
+int    uflag = 0, lflag = 0;
 int    dokerberos = 0;
 char   command = '\0';
 long   dumpnum = 1;
@@ -158,7 +158,7 @@ main(int argc, char *argv[])
 #ifdef KERBEROS
                "k"
 #endif
-               "mMN"
+               "lmMN"
 #ifdef USE_QFA
                "Q:"
 #endif
@@ -214,6 +214,9 @@ main(int argc, char *argv[])
                                    ch, command);
                        command = ch;
                        break;
+               case 'l':
+                       lflag = 1;
+                       break;
                case 'm':
                        mflag = 0;
                        break;
@@ -280,7 +283,11 @@ main(int argc, char *argv[])
 
        atexit(cleanup);
 
-       if (command == 'C' && inputdev[0] != '/' && strcmp(inputdev, "-")) {
+       if (command == 'C' && inputdev[0] != '/' && strcmp(inputdev, "-")
+#ifdef RRESTORE
+           && !strchr(inputdev, ':')
+#endif
+         ) {
                /* since we chdir into the directory we are comparing
                 * to, we must retain the full tape path */
                char wd[MAXPATHLEN], fullpathinput[MAXPATHLEN];
@@ -527,12 +534,12 @@ usage(void)
 
        (void)fprintf(stderr,
          "usage:\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n\t%s%s\n",
-         __progname, " -C [-c" kerbflag "MvVy] [-b blocksize] [-D filesystem] [-f file] [-F script] [-s fileno]",
-         __progname, " -i [-ch" kerbflag "mMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno]",
-         __progname, " -r [-c" kerbflag "MuvVy] [-b blocksize] [-f file] [-F script] [-s fileno] [-T directory]",
-         __progname, " -R [-c" kerbflag "MuvVy] [-b blocksize] [-f file] [-F script] [-s fileno] [-T directory]",
-         __progname, " -t [-ch" kerbflag "MuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]",
-         __progname, " -x [-ch" kerbflag "mMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]");
+         __progname, " -C [-c" kerbflag "lMvVy] [-b blocksize] [-D filesystem] [-f file] [-F script] [-s fileno]",
+         __progname, " -i [-ch" kerbflag "lmMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno]",
+         __progname, " -r [-c" kerbflag "lMuvVy] [-b blocksize] [-f file] [-F script] [-s fileno] [-T directory]",
+         __progname, " -R [-c" kerbflag "lMuvVy] [-b blocksize] [-f file] [-F script] [-s fileno] [-T directory]",
+         __progname, " -t [-ch" kerbflag "lMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]",
+         __progname, " -x [-ch" kerbflag "lmMuvVy] [-b blocksize] [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]");
        exit(1);
 }
 
index b838b1a962ded05a1e863a81e73b6e71241d6ea7..ced86a47b463679bdaa44c984b0e1a738169e8ff 100644 (file)
@@ -29,7 +29,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\"    $Id: restore.8.in,v 1.18 2001/11/10 23:51:00 stelian Exp $
+.\"    $Id: restore.8.in,v 1.19 2001/11/16 14:09:07 stelian Exp $
 .\"
 .Dd __DATE__
 .Dt RESTORE 8
@@ -40,7 +40,7 @@
 .Sh SYNOPSIS
 .Nm restore
 .Fl C
-.Op Fl ckMvVy
+.Op Fl cklMvVy
 .Op Fl b Ar blocksize
 .Op Fl D Ar filesystem
 .Op Fl f Ar file
@@ -49,7 +49,7 @@
 .Op Fl T Ar directory
 .Nm restore
 .Fl i
-.Op Fl chkmMNuvVy
+.Op Fl chklmMNuvVy
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
 .Op Fl F Ar script
@@ -58,7 +58,7 @@
 .Op Fl T Ar directory
 .Nm restore
 .Fl R
-.Op Fl ckMNuvVy
+.Op Fl cklMNuvVy
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
 .Op Fl F Ar script
@@ -66,7 +66,7 @@
 .Op Fl T Ar directory
 .Nm restore
 .Fl r
-.Op Fl ckMNuvVy
+.Op Fl cklMNuvVy
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
 .Op Fl F Ar script
@@ -74,7 +74,7 @@
 .Op Fl T Ar directory
 .Nm restore
 .Fl t
-.Op Fl chkMNuvVy
+.Op Fl chklMNuvVy
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
 .Op Fl F Ar script
@@ -85,7 +85,7 @@
 .Op file ...
 .Nm restore
 .Fl x
-.Op Fl chkmMNuvVy
+.Op Fl chklmMNuvVy
 .Op Fl b Ar blocksize
 .Op Fl f Ar file
 .Op Fl F Ar script
@@ -368,6 +368,13 @@ Extract the actual directory,
 rather than the files that it references.
 This prevents hierarchical restoration of complete subtrees
 from the dump.
+.It Fl l
+When doing remote restores, assume the remote file is a
+regular file (instead of a tape device). If you're restoring
+a remote compressed file, you will need to specify this 
+option or 
+.Nm restore
+will fail to access it correctly.
 .It Fl m
 Extract by inode numbers rather than by file name.
 This is useful if only a few files are being extracted,
index 8e353800ca816b0e78c3b50754f8c69c0589155e..9f5b9c0e41c9ed476e0ff10036487f2f907743ad 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <pop@noos.fr>, 1999-2000
  *     Stelian Pop <pop@noos.fr> - AlcĂ´ve <www.alcove.fr>, 2000
  *
- *     $Id: restore.h,v 1.18 2001/09/12 10:21:49 stelian Exp $
+ *     $Id: restore.h,v 1.19 2001/11/16 14:09:07 stelian Exp $
  */
 
 /*
@@ -55,6 +55,7 @@ extern int    cvtflag;        /* convert from old to new tape format */
 extern int     bflag;          /* set input block size */
 extern int     dflag;          /* print out debugging info */
 extern int     hflag;          /* restore heirarchies */
+extern int     lflag;          /* assume remote filename is a regular file */
 extern int     mflag;          /* restore by name instead of inode number */
 extern int     Mflag;          /* multi-volume restore */
 extern int     Vflag;          /* multi-volume on a single device like CDROM */
index 344ca3b46fadd47079622653e5fcc07f19ac47d4..cd133cb7cf9c63a2b714b1920e6ad2827e2cdd27 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.47 2001/09/12 10:21:49 stelian Exp $";
+       "$Id: tape.c,v 1.48 2001/11/16 14:09:07 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -1929,7 +1929,7 @@ setmagtapein(void) {
                /* need to know if input is really from a tape */
 #ifdef RRESTORE
                if (host)
-                       magtapein = rmtioctl(MTNOP, 1) != -1;
+                       magtapein = !lflag;
                else
 #endif
                        magtapein = ioctl(mt, MTIOCGET, (char *)&mt_stat) == 0;