]> git.wh0rd.org - dump.git/commitdiff
Version 0.4b7. release_0_4b7
authorStelian Pop <stelian@popies.net>
Mon, 11 Oct 1999 13:08:02 +0000 (13:08 +0000)
committerStelian Pop <stelian@popies.net>
Mon, 11 Oct 1999 13:08:02 +0000 (13:08 +0000)
49 files changed:
CHANGES
MCONFIG.in
Makefile.in
THANKS
TODO
common/dumprmt.c
compat/include/Makefile.in [new file with mode: 0644]
compat/include/bsdcompat.h
compat/include/compaterr.h
compat/include/pathnames.h [deleted file]
compat/include/pathnames.h.in [new file with mode: 0644]
compat/lib/compaterr.c
configure
configure.in
debian-patch [deleted file]
dump-0.2.announce [deleted file]
dump-0.2a.announce [deleted file]
dump-0.2b.announce [deleted file]
dump-0.2c.announce [deleted file]
dump-0.2d.announce [deleted file]
dump-0.2e.announce [deleted file]
dump-0.3.announce [deleted file]
dump-0.4b1.announce [deleted file]
dump.lsm
dump/Makefile.in
dump/dump.8 [deleted file]
dump/dump.8.in [new file with mode: 0644]
dump/dump.h
dump/itime.c
dump/main.c
dump/optr.c
dump/tape.c
dump/traverse.c
dump/unctime.c
restore/Makefile.in
restore/dirs.c
restore/extern.h
restore/interactive.c
restore/main.c
restore/restore.8 [deleted file]
restore/restore.8.in [new file with mode: 0644]
restore/restore.c
restore/symtab.c
restore/tape.c
restore/utilities.c
rmt/Makefile.in
rmt/rmt.8 [deleted file]
rmt/rmt.8.in [new file with mode: 0644]
rmt/rmt.c

diff --git a/CHANGES b/CHANGES
index 7e9b6171a3224f278a7cbaac0c4b8fcbcbab659d..5695986ff612bb8b25d4dcc38c5c076231a5c9b2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,53 @@
-Changes between versions 0.4b5 and 0.4b6
-========================================
+Changes between versions 0.4b6 and 0.4b7 (released October 8, 1999)
+===================================================================
+
+1.     Removed the 'k' flag from the restore 'about' text if kerberos
+       was not compiled in.
+
+2.     Prototyped (f)setflags from e2fsprogs and corrected the calls
+       to them (fsetflags takes a char*, setflags an open fd!).
+
+3.     (f)setflags is called only if the flags aren't empty. If the
+       file is a special file, a warning is printed, because changing
+       flags implies opening the device. Normally, a special file
+       should not have any flag... (Debian bug #29775, patch provided
+       by Abhijit Dasgupta <abhijit@ans.net>).
+
+4.     Made possible to dump a file system not mentioned in /etc/fstab.
+       (Debian bug #11904, patch provided by Eirik Fuller <eirik@netcom.com>).
+
+5.     Changed the default behaviour to not create dumpdates
+       unless 'u' option is specified. Removed the old "debian-patch"
+       which provided the same thing. (Debian bug #38136, #33818).
+
+6.     Removed all those dump*announce, since they were getting old...
+
+7.     Added warning messages if dumpdates does not exist and
+       when an inferior level dump does not exist (except for a level 0
+       dump).
+
+8.     Debugged the glob calls in interactive mode: restore used a 
+       dirent struct which was different from the /usr/include/dirent.h
+       one (this used to work, is it a glibc2 change?), so none of the 
+       compat glob (which used /usr/include/dirent.h) or the system glob 
+       worked. Restore use now the system dirent (and the system 
+       DT_* constants), which are compatible with BSD ones.
+
+9.     Added a configure flag (--with-dumpdatespath) to specify
+       the location of dumpdates file. By default, it is 
+       /etc/dumpdates.
+
+10.    Added the "AUTHOR" and "AVAILABILITY" sections and 
+       included the current date/version in man pages.
+
+11.    Corrected the estimation of remaining time when
+       the operator doesn't change the tapes quickly enough. This
+       was an old bug, I thought I corrected it, and discovered
+       that in fact it was corrected in two different places, so
+       the results canceled each other...
+
+Changes between versions 0.4b5 and 0.4b6 (released October 1, 1999)
+===================================================================
 
 1.     Integrated multiple patches from RedHat, Debian and SuSE:
 
 
 1.     Integrated multiple patches from RedHat, Debian and SuSE:
 
@@ -14,13 +62,19 @@ Changes between versions 0.4b5 and 0.4b6
        - workaround egcs bug (RedHat bugs #4281 and #2989).
        - wire $(OPT) throughout Makefile's.
 
        - workaround egcs bug (RedHat bugs #4281 and #2989).
        - wire $(OPT) throughout Makefile's.
 
-2.     Fix some compile warnings, prototype all functions.
+2.     Upgrade the dump revision to 1, making possible to dump filesystems
+       made with e2fsprogs-1.15 or newer. Nothing seems to break...
 
 
-3.     Use glibc err/glob instead of internal compatibility
+3.     Fix some compile warnings, prototype all functions.
+
+4.     Use glibc err/glob instead of internal compatibility
        routines (only if available).
 
        routines (only if available).
 
-Changes between versions 0.4b4 and 0.4b5
-========================================
+5.     Fix a compile error on Linux 2.2.7 / libc5 (5.4.44) (patch provided
+       by Bernhard Sadlowski <sadlowsk@mathematik.uni-bielefeld.de>).
+
+Changes between versions 0.4b4 and 0.4b5 (released September 22, 1999)
+======================================================================
 
 1.     Integrated the changes from FreeBSD-3.1-RELEASE
        (mostly bug fixes, buffer overruns, dump has now an "automatic
 
 1.     Integrated the changes from FreeBSD-3.1-RELEASE
        (mostly bug fixes, buffer overruns, dump has now an "automatic
@@ -37,8 +91,8 @@ Changes between versions 0.4b4 and 0.4b5
 4.     Corrected the long standing bug when dumping multiple tapes.
        This works for me, needs further testing.
 
 4.     Corrected the long standing bug when dumping multiple tapes.
        This works for me, needs further testing.
 
-Changes between versions 0.4b3 and 0.4b4
-========================================
+Changes between versions 0.4b3 and 0.4b4 (released January 17, 1997)
+====================================================================
 
 1.     Dump now runs correctly on kernels 2.1.x
        Fix made by Gerald Peters <gapeters@worldnet.att.net>
 
 1.     Dump now runs correctly on kernels 2.1.x
        Fix made by Gerald Peters <gapeters@worldnet.att.net>
index 7bb041040010b3f1dd34f55d8f33178256e3daf3..4c73edacdd2c44d4b67d5fe59f98f0990e268037 100644 (file)
@@ -2,6 +2,9 @@ VPATH=          $(srcdir)
 
 top_builddir=  @top_builddir@
 
 
 top_builddir=  @top_builddir@
 
+VERSION=       dump 0.4b7
+DATE=          October 8, 1999
+
 AR=            @AR@
 CC=            @CC@
 INSTALL=       @INSTALL@
 AR=            @AR@
 CC=            @CC@
 INSTALL=       @INSTALL@
@@ -24,6 +27,7 @@ INSTALLMAN=   $(INSTALL) -o $(MANOWNER) -g $(MANGRP) -m $(MANMODE)
 BINDIR=                /sbin
 MANDIR=                /usr/man/man8
 
 BINDIR=                /sbin
 MANDIR=                /usr/man/man8
 
+DUMPDATESPATH= @DUMPDATESPATH@
 #
 # Global include directories
 #
 #
 # Global include directories
 #
index 68e861ee1962c1b1a7f06c34e96cd5648f95a9d5..34152c7a47e38619ab06d71d0c948df525b3f4b9 100644 (file)
@@ -4,7 +4,7 @@ top_srcdir=     @top_srcdir@
 @MCONFIG@
 
 RM=            @RM@
 @MCONFIG@
 
 RM=            @RM@
-SUBDIRS=       compat/lib common dump restore @RMTDIR@
+SUBDIRS=       compat/lib compat/include common dump restore @RMTDIR@
 
 all clean install dep depend realclean distclean::
        for i in $(SUBDIRS); do \
 
 all clean install dep depend realclean distclean::
        for i in $(SUBDIRS); do \
diff --git a/THANKS b/THANKS
index 427f2cfd455348b51cb608d2f4511ee7b8161fde..092b0c53294d78e756edac5e80bd9b6b2a182ca2 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -9,7 +9,8 @@ Kevin Layer <layer@Franz.COM> added the comparison code in restore.
 Doug Paul <dbp@dragonsys.com> helped me to make dump able to backup 2GB+
 filesystems.
 
 Doug Paul <dbp@dragonsys.com> helped me to make dump able to backup 2GB+
 filesystems.
 
-David Frey <david@eos.lugs.ch> (the Debian dump maintainer) and the people
+David Frey <david@eos.lugs.ch> (the old Debian dump maintainer), 
+Bdale Garbee <bdale@gag.com> (the new Debian dump maintainer) and the people
 from Red Hat Software provided lots of patches.
 
 Stelian Pop <pop@cybercable.fr> is now the current maintainer (since
 from Red Hat Software provided lots of patches.
 
 Stelian Pop <pop@cybercable.fr> is now the current maintainer (since
@@ -19,7 +20,8 @@ Thanks to people who reported problems with the port, sent patches, and
 suggested various improvements.
 Here is a partial list of them (if I have forgotten someone, please complain):
 
 suggested various improvements.
 Here is a partial list of them (if I have forgotten someone, please complain):
 
-Bdale Garbee           ndale@gag.com
+Abhijit Dasgupta       abhijit@ans.net
+Eirik Fuller           eirik@netcom.com
 Henry Katz             hkatz@hkatz.dialup.access.net
 Klaus Kudielka         kkudielk@cacofonix.nt.tuwien.ac.at
 Florian La Roche       florian@jurix.jura.uni-sb.de
 Henry Katz             hkatz@hkatz.dialup.access.net
 Klaus Kudielka         kkudielk@cacofonix.nt.tuwien.ac.at
 Florian La Roche       florian@jurix.jura.uni-sb.de
diff --git a/TODO b/TODO
index 33b773f7edf4dc964654d8b58c55891d242fd190..1fdb8e3214e2f10dd919267cc29f600873b8ea35 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,3 +5,25 @@
 
 2.     Make dump able to backup several directories and/or files in one
        invocation, like the SunOS version.
 
 2.     Make dump able to backup several directories and/or files in one
        invocation, like the SunOS version.
+
+3.     Verify that dump works correctly on rev 1 ext2fses (need success
+       reports)
+
+4.     More documentation? Examples, crontab?
+
+5.     Verify that dump works with kerberos authentification (this
+       was ported from *BSD and was not tested - in fact, this
+       wasn't even compiled in!). Need success reports for this.
+
+6.     Explore and correct dump problems on a 4GB+ filesystem.
+
+7.     Clean-up the code by removing all those #ifdef _BSD, 
+       since nobody would ever re-compile this on a BSD system. 
+       Since the tape format is the same, the native BSD
+       restore can be used to restore tapes...
+
+8.     Reimplement the ext2 specific code in a "backend" and
+       make the dump code more generic. This would allow creation
+       of other backends for other filesystems. Implementing a 
+       (v)fat backend should be quite easy, as for BSD ffs (we
+       already have the code for this).
index b7cf041ceb07dfb346dbda558faa7265cb8d1006..6a79d0761be16c21956a4a1659ee6fd109793cd5 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)dumprmt.c  8.3 (Berkeley) 4/28/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)dumprmt.c  8.3 (Berkeley) 4/28/95";
 #endif
 static const char rcsid[] =
-       "$Id: dumprmt.c,v 1.3 1999/10/11 12:59:16 stelian Exp $";
+       "$Id: dumprmt.c,v 1.4 1999/10/11 13:08:06 stelian Exp $";
 #endif /* not lint */
 
 #ifdef __linux__
 #endif /* not lint */
 
 #ifdef __linux__
diff --git a/compat/include/Makefile.in b/compat/include/Makefile.in
new file mode 100644 (file)
index 0000000..9c2e02b
--- /dev/null
@@ -0,0 +1,24 @@
+top_srcdir=    @top_srcdir@
+srcdir=                @srcdir@
+
+@MCONFIG@
+
+all::          pathnames.h
+
+pathnames.h:   pathnames.h.in
+       sed -e "s|__DUMPDATES__|$(DUMPDATESPATH)|g" $< > $@
+
+install::
+
+clean::
+       $(RM) -f \#* *~ core pathnames.h
+
+distclean::    clean
+       $(RM) -f Makefile Makefile.old .depend
+
+# +++ Dependency line eater +++
+# 
+# Makefile dependencies follow.  This must be the last section in
+# the Makefile.in file
+#
+
index 421e4cf67ee927efd409214bf11e91ec4e6b1c50..7a3b11e23edf259db31d53062f9534ea8760d032 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <sys/time.h>
 
 #include <config.h>
 #include <sys/time.h>
+#include <dirent.h>
 
 #define        __dead          volatile
 
 
 #define        __dead          volatile
 
@@ -107,7 +108,9 @@ struct dinode {
  * This is the 4.4BSD directory entry structure
  */
 #define DIRBLKSIZ      DEV_BSIZE
  * This is the 4.4BSD directory entry structure
  */
 #define DIRBLKSIZ      DEV_BSIZE
+#ifndef MAXNAMLEN
 #define MAXNAMLEN      255
 #define MAXNAMLEN      255
+#endif
 
 struct direct {
        __u32   d_ino;
 
 struct direct {
        __u32   d_ino;
@@ -121,19 +124,6 @@ struct direct {
        char            d_name[MAXNAMLEN + 1];
 };
 
        char            d_name[MAXNAMLEN + 1];
 };
 
-/*
- * File types
- */
-#define DT_UNKNOWN      0
-#define DT_FIFO                 1
-#define DT_CHR          2
-#define DT_DIR          4
-#define DT_BLK          6
-#define DT_REG          8
-#define DT_LNK         10
-#define DT_SOCK                12
-#define        DT_WHT          14
-
 /*
  * Convert between stat structure types and directory types.
  */
 /*
  * Convert between stat structure types and directory types.
  */
index a45bb983c0caa62b5e52be63f9b5c713c4564526..3aed6ba4a7bc26d3f9b02e2f931387875a9c3e6c 100644 (file)
@@ -39,7 +39,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)err.h       8.1 (Berkeley) 6/2/93
  * SUCH DAMAGE.
  *
  *     @(#)err.h       8.1 (Berkeley) 6/2/93
- *      $Id: compaterr.h,v 1.1 1999/10/11 12:59:17 stelian Exp $
+ *      $Id: compaterr.h,v 1.2 1999/10/11 13:08:06 stelian Exp $
  */
 
 #ifndef _ERR_H_
  */
 
 #ifndef _ERR_H_
diff --git a/compat/include/pathnames.h b/compat/include/pathnames.h
deleted file mode 100644 (file)
index 3e4194a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *     Ported to Linux's Second Extended File System as part of the
- *     dump and restore backup suit
- *     Remy Card <card@Linux.EU.Org>, 1994-1997
- *      Stelian Pop <pop@cybercable.fr>, 1999 
- *
- */
-
-/*
- * Copyright (c) 1989, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *     @(#)pathnames.h 8.1 (Berkeley) 6/5/93
- */
-
-#include <paths.h>
-
-#define        _PATH_DEFTAPE   "/dev/st0"
-#define        _PATH_DTMP      "/etc/dtmp"
-#define        _PATH_DUMPDATES "/etc/dumpdates"
-#define        _PATH_LOCK      "/tmp/dumplockXXXXXX"
-#define        _PATH_RMT       "/etc/rmt"              /* path on remote host */
diff --git a/compat/include/pathnames.h.in b/compat/include/pathnames.h.in
new file mode 100644 (file)
index 0000000..1679565
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *     Ported to Linux's Second Extended File System as part of the
+ *     dump and restore backup suit
+ *     Remy Card <card@Linux.EU.Org>, 1994-1997
+ *      Stelian Pop <pop@cybercable.fr>, 1999 
+ *
+ */
+
+/*
+ * Copyright (c) 1989, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)pathnames.h 8.1 (Berkeley) 6/5/93
+ */
+
+#include <paths.h>
+
+#define        _PATH_DEFTAPE   "/dev/st0"
+#define        _PATH_DTMP      "/etc/dtmp"
+#define        _PATH_DUMPDATES "__DUMPDATES__"
+#define        _PATH_LOCK      "/tmp/dumplockXXXXXX"
+#define        _PATH_RMT       "/etc/rmt"              /* path on remote host */
index a77f1ba5a8a8280533c684b276820f620cff4939..d882068ba629b9136fa47010f84a69dcc6952839 100644 (file)
@@ -42,7 +42,7 @@
 
 #if defined(LIBC_RCS) && !defined(lint)
 static const char rcsid[] =
 
 #if defined(LIBC_RCS) && !defined(lint)
 static const char rcsid[] =
-       "$Id: compaterr.c,v 1.1 1999/10/11 12:59:17 stelian Exp $";
+       "$Id: compaterr.c,v 1.2 1999/10/11 13:08:07 stelian Exp $";
 #endif /* LIBC_RCS and not lint */
 
 #include <compaterr.h>
 #endif /* LIBC_RCS and not lint */
 
 #include <compaterr.h>
index 754af5968a9a69aebcc69898b1eb2ca0761187ec..096ebde0cf1e4f7d31c13c58b1e402a486a42c94 100755 (executable)
--- a/configure
+++ b/configure
@@ -11,8 +11,6 @@
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
-ac_help="$ac_help
-  --enable-dumpdates-patch apply the dumpdates patch from Debian"
 ac_help="$ac_help
   --enable-debug          include debugging code"
 ac_help="$ac_help
 ac_help="$ac_help
   --enable-debug          include debugging code"
 ac_help="$ac_help
@@ -39,6 +37,8 @@ ac_help="$ac_help
   --with-mangrp=group     select group for manual pages"
 ac_help="$ac_help
   --with-manmode=MODE     select mode for manual pages"
   --with-mangrp=group     select group for manual pages"
 ac_help="$ac_help
   --with-manmode=MODE     select mode for manual pages"
+ac_help="$ac_help
+  --with-dumpdatespath=path     select path for dumpdates file"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -1269,21 +1269,6 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-# Check whether --enable-dumpdates-patch or --disable-dumpdates-patch was given.
-if test "${enable_dumpdates_patch+set}" = set; then
-  enableval="$enable_dumpdates_patch"
-  if test "$enableval" = "yes"
-then
-       if test "$PATCH" = ":"
-       then
-               { echo "configure: error: The patch program was not found on your system" 1>&2; exit 1; }
-       fi
-       (cd $srcdir; $PATCH -p < debian-patch)
-fi
-
-fi
-
-
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
@@ -1459,8 +1444,20 @@ echo "MANMODE defaults to $MANMODE"
 fi
 
 
 fi
 
 
+# Check whether --with-dumpdatespath or --without-dumpdatespath was given.
+if test "${with_dumpdatespath+set}" = set; then
+  withval="$with_dumpdatespath"
+  echo "$ac_t""DUMPDATESPATH is $withval" 1>&6
+DUMPDATESPATH=$withval
+else
+  DUMPDATESPATH="/etc/dumpdates"
+echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
+
+fi
+
+
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1464: checking how to run the C preprocessor" >&5
+echo "configure:1461: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1475,13 +1472,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1479 "configure"
+#line 1476 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1492,13 +1489,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1496 "configure"
+#line 1493 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1509,13 +1506,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1513 "configure"
+#line 1510 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1541,17 +1538,17 @@ echo "$ac_t""$CPP" 1>&6
 
 ac_safe=`echo "ext2fs/ext2fs.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ext2fs/ext2fs.h""... $ac_c" 1>&6
 
 ac_safe=`echo "ext2fs/ext2fs.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ext2fs/ext2fs.h""... $ac_c" 1>&6
-echo "configure:1545: checking for ext2fs/ext2fs.h" >&5
+echo "configure:1542: checking for ext2fs/ext2fs.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1550 "configure"
+#line 1547 "configure"
 #include "confdefs.h"
 #include <ext2fs/ext2fs.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <ext2fs/ext2fs.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1574,7 +1571,7 @@ ext2fs_h=no
 fi
 
 echo $ac_n "checking for ext2fs_open in -lext2fs""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking for ext2fs_open in -lext2fs""... $ac_c" 1>&6
-echo "configure:1578: checking for ext2fs_open in -lext2fs" >&5
+echo "configure:1575: checking for ext2fs_open in -lext2fs" >&5
 ac_lib_var=`echo ext2fs'_'ext2fs_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 ac_lib_var=`echo ext2fs'_'ext2fs_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1582,7 +1579,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lext2fs -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
   ac_save_LIBS="$LIBS"
 LIBS="-lext2fs -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1586 "configure"
+#line 1583 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1593,7 +1590,7 @@ int main() {
 ext2fs_open()
 ; return 0; }
 EOF
 ext2fs_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1621,12 +1618,12 @@ fi
 for ac_func in err errx verr verrx vwarn vwarnx warn warnx realpath glob
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 for ac_func in err errx verr verrx vwarn vwarnx warn warnx realpath glob
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1625: checking for $ac_func" >&5
+echo "configure:1622: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1630 "configure"
+#line 1627 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1649,7 +1646,7 @@ $ac_func();
 
 ; return 0; }
 EOF
 
 ; return 0; }
 EOF
-if { (eval echo configure:1653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1675,12 +1672,12 @@ done
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1679: checking for ANSI C header files" >&5
+echo "configure:1676: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1684 "configure"
+#line 1681 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1688,7 +1685,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1705,7 +1702,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1709 "configure"
+#line 1706 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1723,7 +1720,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1727 "configure"
+#line 1724 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1744,7 +1741,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1748 "configure"
+#line 1745 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1755,7 +1752,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
 exit (0); }
 
 EOF
-if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
 then
   :
 else
@@ -1779,12 +1776,12 @@ EOF
 fi
 
 echo $ac_n "checking for quad_t""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking for quad_t""... $ac_c" 1>&6
-echo "configure:1783: checking for quad_t" >&5
+echo "configure:1780: checking for quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_type_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1788 "configure"
+#line 1785 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1812,12 +1809,12 @@ EOF
 fi
 
 echo $ac_n "checking for u_quad_t""... $ac_c" 1>&6
 fi
 
 echo $ac_n "checking for u_quad_t""... $ac_c" 1>&6
-echo "configure:1816: checking for u_quad_t" >&5
+echo "configure:1813: checking for u_quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_type_u_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1821 "configure"
+#line 1818 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1952,7 +1949,7 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "MCONFIG Makefile common/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -2020,6 +2017,7 @@ s%@BINMODE@%$BINMODE%g
 s%@MANOWNER@%$MANOWNER%g
 s%@MANGRP@%$MANGRP%g
 s%@MANMODE@%$MANMODE%g
 s%@MANOWNER@%$MANOWNER%g
 s%@MANGRP@%$MANGRP%g
 s%@MANMODE@%$MANMODE%g
+s%@DUMPDATESPATH@%$DUMPDATESPATH%g
 s%@CPP@%$CPP%g
 s%@top_builddir@%$top_builddir%g
 
 s%@CPP@%$CPP%g
 s%@top_builddir@%$top_builddir%g
 
@@ -2063,7 +2061,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"MCONFIG Makefile common/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE"}
+CONFIG_FILES=\${CONFIG_FILES-"MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
index b6037a01e25b205fc4681281f1928c7c7c80c1ac..a66f6288cab2ccbffb3050b23ca80030c8734c02 100644 (file)
@@ -19,22 +19,6 @@ AC_CHECK_TOOL(PATCH, patch, :)
 AC_PROG_CC
 AC_PROG_INSTALL
 
 AC_PROG_CC
 AC_PROG_INSTALL
 
-dnl
-dnl Handle --enable-dumpdates-patch
-dnl
-AC_ARG_ENABLE([dumpdates-patch],
-[  --enable-dumpdates-patch apply the dumpdates patch from Debian],
-if test "$enableval" = "yes"
-then
-       if test "$PATCH" = ":"
-       then
-               AC_MSG_ERROR(The patch program was not found on your system)
-       fi
-       (cd $srcdir; $PATCH -p < debian-patch)
-fi
-,
-)
-
 dnl
 dnl Handle --enable-debug
 dnl
 dnl
 dnl Handle --enable-debug
 dnl
@@ -207,6 +191,18 @@ echo "MANMODE defaults to $MANMODE"
 )dnl
 AC_SUBST(MANMODE)
 
 )dnl
 AC_SUBST(MANMODE)
 
+dnl
+dnl set $(DUMPDATESPATH) from --with-dumpdatespath
+dnl
+AC_ARG_WITH([dumpdatespath],
+[  --with-dumpdatespath=path     select path for dumpdates file],
+AC_MSG_RESULT(DUMPDATESPATH is $withval)
+DUMPDATESPATH=$withval,
+DUMPDATESPATH="/etc/dumpdates"
+echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
+)dnl
+AC_SUBST(DUMPDATESPATH)
+
 dnl
 dnl Check for Ext2fs headers and libraries
 dnl
 dnl
 dnl Check for Ext2fs headers and libraries
 dnl
@@ -242,4 +238,4 @@ test -d compat/lib || mkdir compat/lib
 dnl
 dnl Output files
 dnl
 dnl
 dnl Output files
 dnl
-AC_OUTPUT(MCONFIG Makefile common/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)
+AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)
diff --git a/debian-patch b/debian-patch
deleted file mode 100644 (file)
index b0349f2..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
---- dump/dump.h.orig   Sun Dec 15 22:14:30 1996
-+++ dump/dump.h        Wed Dec 25 16:11:06 1996
-@@ -40,6 +40,9 @@
-  *    @(#)dump.h      8.2 (Berkeley) 4/28/95
-  */
-+/* /etc/dumpdates will not be created, when not already here (Bug#3806).
-+   David Frey */
-+
- #define MAXINOPB      (MAXBSIZE / sizeof(struct dinode))
- #define MAXNINDIR     (MAXBSIZE / sizeof(daddr_t))
-@@ -195,8 +198,8 @@
- int   nddates;                /* number of records (might be zero) */
- int   ddates_in;              /* we have read the increment file */
- struct        dumpdates **ddatev;     /* the arrayfied version */
--void  initdumptimes __P((void));
--void  getdumptime __P((void));
-+void  initdumptimes __P((int));
-+void  getdumptime __P((int));
- void  putdumptime __P((void));
- #define       ITITERATE(i, ddp) \
-       for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
---- dump/itime.c.orig  Sun Dec 15 22:14:30 1996
-+++ dump/itime.c       Wed Dec 25 16:18:15 1996
-@@ -4,6 +4,8 @@
-  *    Remy Card <card@Linux.EU.Org>, 1994, 1995, 1996
-  *
-  */
-+/* /etc/dumpdates will not be created, when not already here (Bug#3806).
-+   David Frey */
- /*-
-  * Copyright (c) 1980, 1993
-@@ -88,7 +90,8 @@
- static        void readdumptimes __P((FILE *));
- void
--initdumptimes()
-+initdumptimes(createdumpdates)
-+int createdumpdates;
- {
-       FILE *df;
-@@ -101,22 +104,26 @@
-               /*
-                * Dumpdates does not exist, make an empty one.
-                */
--              msg("WARNING: no file `%s', making an empty one\n", dumpdates);
--              if ((df = fopen(dumpdates, "w")) == NULL) {
--                      quit("cannot create %s: %s\n", dumpdates,
--                          strerror(errno));
--                      /* NOTREACHED */
-+              if (createdumpdates) {
-+                msg("WARNING: no file `%s', making an empty one\n", dumpdates);
-+                if ((df = fopen(dumpdates, "w")) == NULL) {
-+                        quit("cannot create %s: %s\n", dumpdates,
-+                            strerror(errno));
-+                        /* NOTREACHED */
-+                }
-+                (void) fclose(df);
-+                if ((df = fopen(dumpdates, "r")) == NULL) {
-+                        quit("cannot read %s even after creating it: %s\n",
-+                            dumpdates, strerror(errno));
-+                        /* NOTREACHED */
-+                }
-               }
-+      }
-+      if (df != NULL) {
-+              (void) flock(fileno(df), LOCK_SH);
-+              readdumptimes(df);
-               (void) fclose(df);
--              if ((df = fopen(dumpdates, "r")) == NULL) {
--                      quit("cannot read %s even after creating it: %s\n",
--                          dumpdates, strerror(errno));
--                      /* NOTREACHED */
--              }
-       }
--      (void) flock(fileno(df), LOCK_SH);
--      readdumptimes(df);
--      (void) fclose(df);
- }
- static void
-@@ -148,7 +155,8 @@
- }
- void
--getdumptime()
-+getdumptime(createdumpdates)
-+int createdumpdates;
- {
-       register struct dumpdates *ddp;
-       register int i;
-@@ -162,7 +170,9 @@
-       spcl.c_ddate = 0;
-       lastlevel = '0';
--      initdumptimes();
-+      initdumptimes(createdumpdates);
-+      if (ddp == NULL)
-+              return;
-       /*
-        *      Go find the entry with the same name for a lower increment
-        *      and older date
---- dump/main.c.orig   Sun Dec 15 22:14:30 1996
-+++ dump/main.c        Wed Dec 25 16:09:26 1996
-@@ -4,6 +4,8 @@
-  *    Remy Card <card@Linux.EU.Org>, 1994, 1995, 1996
-  *
-  */
-+/* /etc/dumpdates will not be created, when not already here (Bug#3806).
-+   David Frey */
- /*-
-  * Copyright (c) 1980, 1991, 1993, 1994
-@@ -331,7 +333,7 @@
-       spcl.c_level = level - '0';
-       spcl.c_type = TS_TAPE;
-       if (!Tflag)
--              getdumptime();          /* /etc/dumpdates snarfed */
-+              getdumptime(uflag);             /* /etc/dumpdates snarfed */
-       msg("Date of this level %c dump: %s", level,
- #ifdef        __linux
---- dump/optr.c.orig   Sun Dec 15 22:14:30 1996
-+++ dump/optr.c        Wed Dec 25 16:09:26 1996
-@@ -4,6 +4,8 @@
-  *    Remy Card <card@Linux.EU.Org>, 1994, 1995, 1996
-  *
-  */
-+/* /etc/dumpdates will not be created, when not already here (Bug#3806).
-+   David Frey */
- /*-
-  * Copyright (c) 1980, 1988, 1993
-@@ -534,22 +536,24 @@
- {
-       register int i;
-       register struct fstab *dt;
--      register struct dumpdates *dtwalk;
-+      register struct dumpdates *dtwalk=NULL;
-       char *lastname, *date;
-       int dumpme;
-       time_t tnow;
-       (void) time(&tnow);
-       getfstab();             /* /etc/fstab input */
--      initdumptimes();        /* /etc/dumpdates input */
--      qsort((char *) ddatev, nddates, sizeof(struct dumpdates *), datesort);
--
--      if (arg == 'w')
--              (void) printf("Dump these file systems:\n");
--      else
-+      initdumptimes(0);       /* /etc/dumpdates input */
-+      if (*ddatev != NULL)
-+      {
-+        qsort((char *) ddatev, nddates, sizeof(struct dumpdates *), datesort);
-+
-+        if (arg == 'w')
-+              (void) printf("Dump these file systems:\n");
-+        else
-               (void) printf("Last dump(s) done (Dump '>' file systems):\n");
--      lastname = "??";
--      ITITERATE(i, dtwalk) {
-+        lastname = "??";
-+        ITITERATE(i, dtwalk) {
-               if (strncmp(lastname, dtwalk->dd_name,
-                   sizeof(dtwalk->dd_name)) == 0)
-                       continue;
-@@ -568,6 +572,7 @@
-                           dt ? dt->fs_file : "",
-                           dtwalk->dd_level,
-                           date);
-+        }
-       }
- }
diff --git a/dump-0.2.announce b/dump-0.2.announce
deleted file mode 100644 (file)
index 9ddec37..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-
-       Finally...  The public test version of my port of the 4.4BSD dump
-and restore programs to Linux is now available on tsx-11.mit.edu in the
-directory /pub/linux/packages/ext2fs.
-
-       This port understands the Ext2fs structure and is able to backup
-and restore Linux Ext2 filesystems.  This is a test version and I have only
-made minimal testing so do not rely too much on it for your backups.
-
-       This version of dump contains all the BSD features and also includes
-some enhancements over the previous test versions:
-       - it is possible to backup a subtree instead of a whole filesystem,
-       - some bugs have been fixed :-)
-       - dump is now able to backup filesystems bigger than 2 GB,
-       - the dump format is now compatible with 4.3BSD.  This means that you
-         can restore Linux dumps on BSD based operating systems and you can
-         restore BSD dumps on Linux.  I have made some tests with FreeBSD
-         and SunOS 4.1.3 and this works fine.  I am interested in reports
-         about other BSD based operating systems.
-
-       I am not sure that multi-volume dumps are Ok.  If you use them, please
-send me a bug (or success :-) report.
-
-       The dump format is *not* compatible with the previous test versions
-(versions 0.0 and 0.1), which were distributed as private test versions.  If
-you have backups made by dump 0.0 or 0.1, restore 0.2 will not be able to
-read them.
-
-       You need the latest ext2fs programs source distribution to compile dump
-and restore because I have used Theodore T'so's Ext2fs library.  The latest
-version (0.5b) of these programs is available on tsx-11.mit.edu in the
-directory /pub/linux/packages/ext2fs.  If you want to build ELF binaries, you
-also need to get my ELF patch on ftp.ibp.fr in /pub/linux/ELF/patches.
-
-       I'd like to thank all the people who have used the private test
-versions of dump and restore.  I have appreciated their feedback that has
-helped me to improve dump and restore.
-
---
-Remy Card
-Remy.Card@freenix.fr
diff --git a/dump-0.2a.announce b/dump-0.2a.announce
deleted file mode 100644 (file)
index 130ac8a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-       I have received bug reports about dump telling that dump receives
-unexpected signals when dump directories (in pass III).  I have tried to
-reproduce the problem and it appears that this may be caused by an optimization
-problem in some versions of gcc.  Dump works fine when compiled with
-optimization by gcc 2.6.2 but it fails when compiled by gcc 2.6.3:
-       - either it gets an unexpected signal (SIGFPE),
-       - or it issues warnings ``Warning: dumpdirino called with file type
-         040000'' and does not dump directories.
-
-       I am not courageous enough to study the assembly code generated by
-gcc (yet :-), so I have modified the Makefiles to compile dump without
-optimizations.  I have also fixed a few minor bugs and removed some printf's
-that I had added during my tests.  I will study the assembly code generated
-by gcc soon and fix the problem.
-
-       The fixed version (numbered 0.2a) is now available on tsx-11.mit.edu
-in the directory /pub/linux/packages/ext2fs.  Please get it if you are using
-dump and restore.
-
-       Thanks to Daniel Veillard <Daniel.Veillard@imag.fr>, Bob Snyder
-<rsnyder@janet.advsys.com>, and Florian La Roche <rzsfl@rz.uni-sb.de> for
-their reports and their help!
-
---
-Remy Card
-Remy.Card@freenix.fr
diff --git a/dump-0.2b.announce b/dump-0.2b.announce
deleted file mode 100644 (file)
index b378ec4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-
-       I have received bug reports about dump telling that dump receives
-unexpected signals when dump directories (in pass III).  I have tried to
-reproduce the problem and it appears that this may be caused by an optimization
-problem in some versions of gcc.  Dump works fine when compiled with
-optimization by gcc 2.6.2 but it fails when compiled by gcc 2.6.3:
-       - either it gets an unexpected signal (SIGFPE),
-       - or it issues warnings ``Warning: dumpdirino called with file type
-         040000'' and does not dump directories.
-
-       Finding the problem was not an easy task because the behavior seemed
-to be related to the version of the compiler.  Anyway, I have found it :-)
-There was an incorrect assignement in the function dumpdirino(), which is
-responsible for dumping the contents of directories, and this caused some
-problems when compiled with optimizations by some versions of gcc.  After
-fixing the problem, dump runs fine when compiled by gcc 2.6.3 or gcc 2.7.0.
-
-       The new fixed version (numbered 0.2b) is now available on
-tsx-11.mit.edu in the directory /pub/linux/packages/ext2fs.  Please get it
-if you are using dump and restore.
-
-       Thanks to Daniel Veillard <Daniel.Veillard@imag.fr>, Bob Snyder
-<rsnyder@janet.advsys.com>, and Florian La Roche <rzsfl@rz.uni-sb.de> for
-their reports and their help!
-
---
-Remy Card
-Remy.Card@freenix.fr
diff --git a/dump-0.2c.announce b/dump-0.2c.announce
deleted file mode 100644 (file)
index d0da6b7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-       Yet another bug fix release of dump/restore for Ext2fs is available
-on tsx-11.mit.edu in /pub/linux/packages/ext2fs/dump-0.2c.tar.gz.
-
-       A stupid bug has been fixed.  This bug caused an incorrect dump of
-``slow'' (i.e. normal) symbolic links.  There is no new features (yet :-).
-
-       Thanks to the many people who have sent me success and bug reports!
-
---
-Remy Card
-Remy.Card@freenix.fr
diff --git a/dump-0.2d.announce b/dump-0.2d.announce
deleted file mode 100644 (file)
index afc10d5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-       Ok, I am still trying to saturate comp.os.linux.announce :-)  Yet
-another bug fix release of dump/restore for Ext2fs is available on
-tsx-11.mit.edu in /pub/linux/packages/ext2fs/dump-0.2d.tar.gz.
-
-       Dump is now able to backup 2GB+ filesystems.  Thanks to Doug Paul
-<dbp@dragonsys.com> for the patch.  Dump and restore can now be linked as
-static binaries (you have to edit the file MCONFIG before building them).
-
---
-Remy Card
-Remy.Card@freenix.fr
diff --git a/dump-0.2e.announce b/dump-0.2e.announce
deleted file mode 100644 (file)
index cdf5c0b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-       Dump 0.2e is now available on tsx-11.mit.edu in the directory
-/pub/linux/packages/ext2fs.
-
-       A stupid bug in the "set owner/mode" pass has been fixed.  Files were
-restored with uid=0 and gid=0.  The bug was in restore, not in dump, so this
-means that backups made with dump 0.2d are Ok.  Thanks to Brent Olson
-<night@halcyon.com> for reporting this problem.
-
-       Thanks also to the patience of the testers :-)
-
-       I remind you that dump and restore should be considered as software
-in BETA test.  Don't rely too much on them for your backups...
-
---
-Remy Card
-Remy.Card@freenix.fr
-
-No to french nuclear experiments!
diff --git a/dump-0.3.announce b/dump-0.3.announce
deleted file mode 100644 (file)
index c5ebc2a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-
-       Ok, I'm back ;-)
-
-       Dump 0.3 is now available on tsx-11.mit.edu in the directory
-/pub/linux/packages/ext2fs.
-
-       Restore is now able to restore named pipes (fifos).  Thanks to
-Jason Venner <jason@idiom.com> for reporting the bug.  I have also fixed
-a bug in the symlink restoration: owner and group were not set by previous
-version.  Thanks to Klaus Kudielka <kkudielk@cacofonix.nt.tuwien.ac.at> for
-reporting it.  Restore is now able to restore correctly files ending with
-a hole (mainly DLL shared libraries under Linux).  Thanks to David Monro
-<davidm@cs.su.oz.au> for sending me a patch much cleaner than mine :-)
-
-       Kevin Layer <layer@Franz.COM> has implemented a verify option in
-restore.  It is now possible to check a dump against the contents of the
-filesystem.  Thank you very much, Kevin!
-
-       Some bug fixes from FreeBSD 2.2-current have also been integrated.
-
-       Last, I have added the file `linux-1.2.x.patch' in the distribution. 
-This patch for 1.2 kernels should be applied if you want to get better
-performances.
-
-       I remind you that dump and restore should be considered as software
-in BETA test.  Don't rely too much on them for your backups...
-
---
-Remy Card
-Remy.Card@freenix.fr
-
-No to nuclear testings!
diff --git a/dump-0.4b1.announce b/dump-0.4b1.announce
deleted file mode 100644 (file)
index 9054672..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-
-       A test release of dump 0.4 is now available on tsx-11.mit.edu,
-in the file /pub/linux/ALPHA/ext2fs/dump-0.4b1.tar.gz.
-
-       This new version is based on the latest dump and restore suite
-available from Berkeley (I have integrated the changes from 4.4BSD-Lite2).
-
-       It also includes lots of changes from the Debian 1.2 and Red Hat 4.0
-distributions (I have included most of the patches made by maintainers of
-these distributions).
-
-       Some changes were made to improve the portability of dump and restore:
-       - fixed size types are now used, so that the dump format is the same
-         on every architecture supported by Linux,
-       - dump now uses the Ext2fs library to get the block addresses
-         to solve an endianness problem that was present on SparcLinux.
-
-       Autoconf is now used to configure dump and restore.  I have shamelessly
-adapted the configure script from the one present in the e2fsprogs
-distribution (thanks Ted!).
-
-       Last, a few minor bugs have been fixed.
-
-       This version is a test release.  Use it only for testing :-)  New
-beta versions will probably be released before a stable dump 0.4 version is
-available.
-
-       If you encounter problems with this test release, please send a
-detailled bug report (please look at the file KNOWNBUGS before sending a
-bug report).
-
---
-Remy Card
-card@Linux.EU.Org
-
index b72e9abfd4a93df79a2c50673800f5e969226968..4c5c534050d9cdf3e202073770eb7585a8e9773d 100644 (file)
--- a/dump.lsm
+++ b/dump.lsm
@@ -1,15 +1,15 @@
 Begin3
 Title:          dump and restore for Ext2fs
 Begin3
 Title:          dump and restore for Ext2fs
-Version:        0.4b6
-Entered-date:   03OCT99
+Version:        0.4b7
+Entered-date:   08OCT99
 Description:    Port of the 4.4BSD dump and restore backup suite
 Keywords:       backup, filesystem, Ext2fs
 Author:         University of California, Berkeley
 Maintained-by:  pop@cybercable.fr (Stelian Pop)
 Primary-site:   tsx-11.mit.edu /pub/linux/ALPHA/ext2fs
 Description:    Port of the 4.4BSD dump and restore backup suite
 Keywords:       backup, filesystem, Ext2fs
 Author:         University of California, Berkeley
 Maintained-by:  pop@cybercable.fr (Stelian Pop)
 Primary-site:   tsx-11.mit.edu /pub/linux/ALPHA/ext2fs
-                132kB dump-0.4b6.tar.gz
-                627 dump.lsm
-Alternate-site: 
+                129kB dump-0.4b7.tar.gz
+                677 dump.lsm
+Alternate-site: http://perso.cybercable.fr/pop/dump
 Original-site:  ftp.freebsd.org /pub/bsd-sources/4.4BSD-Lite2/sbin
                 dump/*
                 restore/*
 Original-site:  ftp.freebsd.org /pub/bsd-sources/4.4BSD-Lite2/sbin
                 dump/*
                 restore/*
index a2e872ac4d8298d1e35141309f4cd139a5e9df75..2843a7b9ef595cf67771e98ce38a7d6e69b8dff0 100644 (file)
@@ -16,12 +16,17 @@ OBJS=               itime.o main.o optr.o tape.o traverse.o unctime.o \
 MAN8=          dump.8
 MLINKS=                dump.8 $(MANDIR)/rdump.8
 
 MAN8=          dump.8
 MLINKS=                dump.8 $(MANDIR)/rdump.8
 
-all::          $(PROG)
+all::          $(PROG) dump.8
 
 $(PROG):       $(OBJS) $(DEPLIBS)
        $(LD) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)
 
 
 $(PROG):       $(OBJS) $(DEPLIBS)
        $(LD) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)
 
-install::      $(PROG)
+dump.8:                dump.8.in
+       sed -e "s|__DUMPDATES__|$(DUMPDATESPATH)|g" \
+           -e "s|__DATE__|$(DATE)|g" \
+           -e "s|__VERSION__|$(VERSION)|g" $< > $@
+
+install::      all
        $(INSTALLBIN) $(PROG) $(BINDIR)
        $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR)
        @set $(LINKS) $(MLINKS); \
        $(INSTALLBIN) $(PROG) $(BINDIR)
        $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR)
        @set $(LINKS) $(MLINKS); \
@@ -36,7 +41,7 @@ install::     $(PROG)
        done; true
 
 clean::
        done; true
 
 clean::
-       $(RM) -f $(PROG) \#* *.s *.o *.a *~ core
+       $(RM) -f $(PROG) \#* *.s *.o *.a *~ core dump.8
 
 distclean::    clean
        $(RM) -f Makefile Makefile.old .depend
 
 distclean::    clean
        $(RM) -f Makefile Makefile.old .depend
diff --git a/dump/dump.8 b/dump/dump.8
deleted file mode 100644 (file)
index b7f427e..0000000
+++ /dev/null
@@ -1,449 +0,0 @@
-.\" Copyright (c) 1980, 1991, 1993
-.\"     Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"    This product includes software developed by the University of
-.\"    California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"     @(#)dump.8     8.3 (Berkeley) 5/1/95
-.\"    $Id: dump.8,v 1.3 1999/10/11 12:59:18 stelian Exp $
-.\"
-.Dd June 4, 1997
-.Dt DUMP 8
-.Os BSD 4
-.Sh NAME
-.Nm dump
-.Nd ext2 filesystem backup
-.Sh SYNOPSIS
-.Nm dump
-.Op Fl 0123456789acknu
-.Op Fl B Ar records
-.Op Fl b Ar blocksize
-.Op Fl d Ar density
-.Op Fl f Ar file
-.Op Fl h Ar level
-.Op Fl L Ar label
-.Op Fl s Ar feet
-.Op Fl T Ar date
-.Ar filesystem
-.Nm dump
-.Op Fl 0123456789acknu
-.Op Fl B Ar records
-.Op Fl b Ar blocksize
-.Op Fl d Ar density
-.Op Fl f Ar file
-.Op Fl h Ar level
-.Op Fl L Ar label
-.Op Fl s Ar feet
-.Op Fl T Ar date
-.Ar directory
-.Nm dump
-.Op Fl W Li \&| Fl w
-.Pp
-.in -\\n(iSu
-(The
-.Bx 4.3
-option syntax is implemented for backward compatibility but
-is not documented here.)
-.Sh DESCRIPTION
-.Nm Dump
-examines files
-on an ext2 filesystem
-and determines which files
-need to be backed up. These files
-are copied to the given disk, tape or other
-storage medium for safe keeping (see the
-.Fl f
-option below for doing remote backups).
-A dump that is larger than the output medium is broken into
-multiple volumes.
-On most media the size is determined by writing until an
-end-of-media indication is returned. This can be enforced
-by using the
-.Fl a
-option.
-.Pp
-On media that cannot reliably return an end-of-media indication
-(such as some cartridge tape drives),
-each volume is of a fixed size;
-the actual size is determined by the tape size, density and/or
-block count options below.
-By default, the same output file name is used for each volume
-after prompting the operator to change media.
-.Pp
-The following options are supported by
-.Nm Ns :
-.Bl -tag -width Ds
-.It Fl 0\-9
-Dump levels.
-A level 0, full backup,
-guarantees the entire file system is copied
-(but see also the
-.Fl h
-option below).
-A level number above 0,
-incremental backup,
-tells
-.Nm dump
-to
-copy all files new or modified since the
-last dump of the same or lower level.
-The default level is 9.
-.It Fl B Ar records
-The number of 1 KB blocks per volume.
-This option overrides the calculation of tape size
-based on length and density.
-.It Fl a
-.Dq auto-size .
-Bypass all tape length considerations, and enforce writing
-until an end-of-media indication is returned.  This fits best
-for most modern tape drives.  Use of this option is particularly
-recommended when appending to an existing tape, or using a tape
-drive with hardware compression (where you can never be sure about
-the compression ratio).
-.It Fl b Ar blocksize
-The number of kilobytes per dump record.
-Since the IO system slices all requests into chunks of MAXBSIZE
-(typically 64KB), it is not possible to use a larger blocksize
-without having problems later with
-.Xr restore 8 .
-Therefore
-.Nm dump
-will constrain writes to MAXBSIZE.
-.It Fl c
-Change the defaults for use with a cartridge tape drive, with a density
-of 8000 bpi, and a length of 1700 feet.
-.It Fl h Ar level
-Honor the user
-.Dq nodump
-flag
-.Dp Dv UF_NODUMP
-only for dumps at or above the given
-.Ar level .
-The default honor level is 1,
-so that incremental backups omit such files
-but full backups retain them.
-.It Fl d Ar density
-Set tape density to
-.Ar density .
-The default is 1600BPI.
-.It Fl f Ar file
-Write the backup to
-.Ar file ;
-.Ar file
-may be a special device file
-like
-.Pa /dev/st0
-(a tape drive),
-.Pa /dev/rsd1c
-(a floppy disk drive),
-an ordinary file,
-or
-.Ql Fl
-(the standard output).
-Multiple file names may be given as a single argument separated by commas.
-Each file will be used for one dump volume in the order listed;
-if the dump requires more volumes than the number of names given,
-the last file name will used for all remaining volumes after prompting
-for media changes.
-If the name of the file is of the form
-.Dq host:file
-or
-.Dq user@host:file
-.Nm
-writes to the named file on the remote host using
-.Xr rmt 8 .
-The default path name of the remote
-.Xr rmt 8
-program is
-.\" rmt path, is the path on the remote host
-.Pa /etc/rmt ;
-this can be overridden by the environment variable
-.Ev RMT .
-.It Fl k
-Use Kerberos authentication to talk to remote tape servers.  (Only
-available if this option was enabled when
-.Nm
-was compiled.)
-.It Fl L Ar label
-The user-supplied text string
-.Ar label
-is placed into the dump header, where tools like
-.Xr restore 8
-and
-.Xr file 1
-can access it.
-Note that this label is limited
-to be at most LBLSIZE (currently 16) characters, which must include
-the terminating
-.Ql \e0 .
-.It Fl n
-Whenever
-.Nm
-requires operator attention,
-notify all operators in the group
-.Dq operator
-by means similar to a
-.Xr wall 1 .
-.It Fl s Ar feet
-Attempt to calculate the amount of tape needed
-at a particular density.
-If this amount is exceeded,
-.Nm
-prompts for a new tape.
-It is recommended to be a bit conservative on this option.
-The default tape length is 2300 feet.
-.ne 1i
-.It Fl T Ar date
-Use the specified date as the starting time for the dump
-instead of the time determined from looking in
-.Pa /etc/dumpdates .
-The format of
-.Ar date
-is the same as that of
-.Xr ctime 3 .
-This option is useful for automated dump scripts that wish to
-dump over a specific period of time.
-The
-.Fl T
-option is mutually exclusive from the
-.Fl u
-option.
-.It Fl u
-Update the file
-.Pa /etc/dumpdates
-after a successful dump.
-The format of
-.Pa /etc/dumpdates
-is readable by people, consisting of one
-free format record per line:
-filesystem name,
-increment level
-and
-.Xr ctime 3
-format dump date. 
-There may be only one entry per filesystem at each level.
-The file
-.Pa /etc/dumpdates
-may be edited to change any of the fields,
-if necessary.
-.It Fl W
-.Nm Dump
-tells the operator what file systems need to be dumped.
-This information is gleaned from the files
-.Pa /etc/dumpdates
-and
-.Pa /etc/fstab .
-The
-.Fl W
-option causes
-.Nm
-to print out, for each file system in
-.Pa /etc/dumpdates ,
-the most recent dump date and level,
-and highlights those file systems that should be dumped.
-If the
-.Fl W
-option is set, all other options are ignored, and
-.Nm
-exits immediately.
-.It Fl w
-Is like
-.Fl W ,
-but prints only those filesystems which need to be dumped.
-.El
-.Pp
-.Nm Dump
-requires operator intervention on these conditions:
-end of tape,
-end of dump,
-tape write error,
-tape open error or
-disk read error (if there is more than a threshold of 32).
-In addition to alerting all operators implied by the
-.Fl n
-key,
-.Nm
-interacts with the operator on
-.Em dump's
-control terminal at times when
-.Nm
-can no longer proceed,
-or if something is grossly wrong.
-All questions
-.Nm
-poses
-.Em must
-be answered by typing
-.Dq yes
-or
-.Dq no ,
-appropriately.
-.Pp
-Since making a dump involves a lot of time and effort for full dumps,
-.Nm
-checkpoints itself at the start of each tape volume.
-If writing that volume fails for some reason,
-.Nm
-will,
-with operator permission,
-restart itself from the checkpoint
-after the old tape has been rewound and removed,
-and a new tape has been mounted.
-.Pp
-.Nm Dump
-tells the operator what is going on at periodic intervals,
-including usually low estimates of the number of blocks to write,
-the number of tapes it will take, the time to completion, and
-the time to the tape change.
-The output is verbose,
-so that others know that the terminal
-controlling
-.Nm
-is busy,
-and will be for some time.
-.Pp
-In the event of a catastrophic disk event, the time required
-to restore all the necessary backup tapes or files to disk
-can be kept to a minimum by staggering the incremental dumps.
-An efficient method of staggering incremental dumps
-to minimize the number of tapes follows:
-.Bl -bullet -offset indent
-.It
-Always start with a level 0 backup, for example:
-.Bd -literal -offset indent
-/sbin/dump -0u -f /dev/nrst1 /usr/src
-.Ed
-.Pp
-This should be done at set intervals, say once a month or once every two months,
-and on a set of fresh tapes that is saved forever.
-.It
-After a level 0, dumps of active file
-systems are taken on a daily basis,
-using a modified Tower of Hanoi algorithm,
-with this sequence of dump levels:
-.Bd -literal -offset indent
-3 2 5 4 7 6 9 8 9 9 ...
-.Ed
-.Pp
-For the daily dumps, it should be possible to use a fixed number of tapes
-for each day, used on a weekly basis.
-Each week, a level 1 dump is taken, and
-the daily Hanoi sequence repeats beginning with 3.
-For weekly dumps, another fixed set of tapes per dumped file system is
-used, also on a cyclical basis.
-.El
-.Pp
-After several months or so, the daily and weekly tapes should get
-rotated out of the dump cycle and fresh tapes brought in.
-.Sh ENVIRONMENT
-.Bl -tag -width Fl
-.It Ev TAPE
-If no -f option was specified,
-.Nm
-will use the device specified via
-.Ev TAPE
-as the dump device.
-.Ev TAPE
-may be of the form
-.Qq tapename ,
-.Qq host:tapename ,
-or
-.Qq user@host:tapename .
-.It Ev RMT
-The environment variable
-.Ev RMT
-will be used to determine the pathname of the remote
-.Xr rmt 8
-program.
-.Sh FILES
-.Bl -tag -width /etc/dumpdates -compact
-.It Pa /dev/st0
-default tape unit to dump to
-.It Pa /etc/dumpdates
-dump date records
-.It Pa /etc/fstab
-dump table: file systems and frequency
-.It Pa /etc/group
-to find group
-.Em operator
-.El
-.Sh SEE ALSO
-.Xr fstab 5 ,
-.Xr restore 8 ,
-.Xr rmt 8
-.Sh DIAGNOSTICS
-Many, and verbose.
-.Pp
-.Nm Dump
-exits with zero status on success.
-Startup errors are indicated with an exit code of 1;
-abnormal termination is indicated with an exit code of 3.
-.Sh BUGS
-It might be considered a bug that this version of dump can only handle ext2
-filesystems.  Specifically, it does not work with FAT filesystems.
-.Pp
-Fewer than 32 read errors on the filesystem are ignored. If noticing
-read errors is important, the output from dump can be parsed to look for lines
-that contain the text 'read error'.
-.Pp
-Each reel requires a new process, so parent processes for
-reels already written just hang around until the entire tape
-is written.
-.Pp
-.Nm Dump
-with the
-.Fl W
-or
-.Fl w
-option does not report filesystems that have never been recorded
-in
-.Pa /etc/dumpdates ,
-even if listed in
-.Pa /etc/fstab .
-.Pp
-It would be nice if
-.Nm
-knew about the dump sequence,
-kept track of the tapes scribbled on,
-told the operator which tape to mount when,
-and provided more assistance
-for the operator running
-.Xr restore .
-.Pp
-.Nm Dump
-cannot do remote backups without being run as root, due to its
-security history.  This will be fixed in a later version of
-.Bx Free .
-Presently, it works if you set it setuid (like it used to be), but this
-might constitute a security risk.
-.Sh HISTORY
-A
-.Nm
-command appeared in
-.At v6 .
diff --git a/dump/dump.8.in b/dump/dump.8.in
new file mode 100644 (file)
index 0000000..84e462c
--- /dev/null
@@ -0,0 +1,467 @@
+.\" Copyright (c) 1980, 1991, 1993
+.\"     Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)dump.8     8.3 (Berkeley) 5/1/95
+.\"    $Id: dump.8.in,v 1.1 1999/10/11 13:08:07 stelian Exp $
+.\"
+.Dd __DATE__
+.Dt DUMP 8
+.Os "__VERSION__"
+.Sh NAME
+.Nm dump
+.Nd ext2 filesystem backup
+.Sh SYNOPSIS
+.Nm dump
+.Op Fl 0123456789acknu
+.Op Fl B Ar records
+.Op Fl b Ar blocksize
+.Op Fl d Ar density
+.Op Fl f Ar file
+.Op Fl h Ar level
+.Op Fl L Ar label
+.Op Fl s Ar feet
+.Op Fl T Ar date
+.Ar filesystem
+.Nm dump
+.Op Fl 0123456789acknu
+.Op Fl B Ar records
+.Op Fl b Ar blocksize
+.Op Fl d Ar density
+.Op Fl f Ar file
+.Op Fl h Ar level
+.Op Fl L Ar label
+.Op Fl s Ar feet
+.Op Fl T Ar date
+.Ar directory
+.Nm dump
+.Op Fl W Li \&| Fl w
+.Pp
+.in
+(The
+.Bx 4.3
+option syntax is implemented for backward compatibility but
+is not documented here.)
+.Sh DESCRIPTION
+.Nm Dump
+examines files
+on an ext2 filesystem
+and determines which files
+need to be backed up. These files
+are copied to the given disk, tape or other
+storage medium for safe keeping (see the
+.Fl f
+option below for doing remote backups).
+A dump that is larger than the output medium is broken into
+multiple volumes.
+On most media the size is determined by writing until an
+end-of-media indication is returned. This can be enforced
+by using the
+.Fl a
+option.
+.Pp
+On media that cannot reliably return an end-of-media indication
+(such as some cartridge tape drives),
+each volume is of a fixed size;
+the actual size is determined by the tape size, density and/or
+block count options below.
+By default, the same output file name is used for each volume
+after prompting the operator to change media.
+.Pp
+The following options are supported by
+.Nm Ns :
+.Bl -tag -width Ds
+.It Fl 0\-9
+Dump levels.
+A level 0, full backup,
+guarantees the entire file system is copied
+(but see also the
+.Fl h
+option below).
+A level number above 0,
+incremental backup,
+tells
+.Nm dump
+to
+copy all files new or modified since the
+last dump of the same or lower level.
+The default level is 9.
+.It Fl B Ar records
+The number of 1 KB blocks per volume.
+This option overrides the calculation of tape size
+based on length and density.
+.It Fl a
+.Dq auto-size .
+Bypass all tape length considerations, and enforce writing
+until an end-of-media indication is returned.  This fits best
+for most modern tape drives.  Use of this option is particularly
+recommended when appending to an existing tape, or using a tape
+drive with hardware compression (where you can never be sure about
+the compression ratio).
+.It Fl b Ar blocksize
+The number of kilobytes per dump record.
+Since the IO system slices all requests into chunks of MAXBSIZE
+(typically 64KB), it is not possible to use a larger blocksize
+without having problems later with
+.Xr restore 8 .
+Therefore
+.Nm dump
+will constrain writes to MAXBSIZE.
+.It Fl c
+Change the defaults for use with a cartridge tape drive, with a density
+of 8000 bpi, and a length of 1700 feet.
+.It Fl h Ar level
+Honor the user
+.Dq nodump
+flag
+.Dp Dv UF_NODUMP
+only for dumps at or above the given
+.Ar level .
+The default honor level is 1,
+so that incremental backups omit such files
+but full backups retain them.
+.It Fl d Ar density
+Set tape density to
+.Ar density .
+The default is 1600BPI.
+.It Fl f Ar file
+Write the backup to
+.Ar file ;
+.Ar file
+may be a special device file
+like
+.Pa /dev/st0
+(a tape drive),
+.Pa /dev/rsd1c
+(a floppy disk drive),
+an ordinary file,
+or
+.Ql Fl
+(the standard output).
+Multiple file names may be given as a single argument separated by commas.
+Each file will be used for one dump volume in the order listed;
+if the dump requires more volumes than the number of names given,
+the last file name will used for all remaining volumes after prompting
+for media changes.
+If the name of the file is of the form
+.Dq host:file
+or
+.Dq user@host:file
+.Nm
+writes to the named file on the remote host using
+.Xr rmt 8 .
+The default path name of the remote
+.Xr rmt 8
+program is
+.\" rmt path, is the path on the remote host
+.Pa /etc/rmt ;
+this can be overridden by the environment variable
+.Ev RMT .
+.It Fl k
+Use Kerberos authentication to talk to remote tape servers.  (Only
+available if this option was enabled when
+.Nm
+was compiled.)
+.It Fl L Ar label
+The user-supplied text string
+.Ar label
+is placed into the dump header, where tools like
+.Xr restore 8
+and
+.Xr file 1
+can access it.
+Note that this label is limited
+to be at most LBLSIZE (currently 16) characters, which must include
+the terminating
+.Ql \e0 .
+.It Fl n
+Whenever
+.Nm
+requires operator attention,
+notify all operators in the group
+.Dq operator
+by means similar to a
+.Xr wall 1 .
+.It Fl s Ar feet
+Attempt to calculate the amount of tape needed
+at a particular density.
+If this amount is exceeded,
+.Nm
+prompts for a new tape.
+It is recommended to be a bit conservative on this option.
+The default tape length is 2300 feet.
+.ne 1i
+.It Fl T Ar date
+Use the specified date as the starting time for the dump
+instead of the time determined from looking in
+.Pa __DUMPDATES__ .
+The format of
+.Ar date
+is the same as that of
+.Xr ctime 3 .
+This option is useful for automated dump scripts that wish to
+dump over a specific period of time.
+The
+.Fl T
+option is mutually exclusive from the
+.Fl u
+option.
+.It Fl u
+Update the file
+.Pa __DUMPDATES__
+after a successful dump.
+The format of
+.Pa __DUMPDATES__
+is readable by people, consisting of one
+free format record per line:
+filesystem name,
+increment level
+and
+.Xr ctime 3
+format dump date. 
+There may be only one entry per filesystem at each level.
+The file
+.Pa __DUMPDATES__
+may be edited to change any of the fields,
+if necessary.
+.It Fl W
+.Nm Dump
+tells the operator what file systems need to be dumped.
+This information is gleaned from the files
+.Pa __DUMPDATES__
+and
+.Pa /etc/fstab .
+The
+.Fl W
+option causes
+.Nm
+to print out, for each file system in
+.Pa __DUMPDATES__ ,
+the most recent dump date and level,
+and highlights those file systems that should be dumped.
+If the
+.Fl W
+option is set, all other options are ignored, and
+.Nm
+exits immediately.
+.It Fl w
+Is like
+.Fl W ,
+but prints only those filesystems which need to be dumped.
+.El
+.Pp
+.Nm Dump
+requires operator intervention on these conditions:
+end of tape,
+end of dump,
+tape write error,
+tape open error or
+disk read error (if there is more than a threshold of 32).
+In addition to alerting all operators implied by the
+.Fl n
+key,
+.Nm
+interacts with the operator on
+.Em dump's
+control terminal at times when
+.Nm
+can no longer proceed,
+or if something is grossly wrong.
+All questions
+.Nm
+poses
+.Em must
+be answered by typing
+.Dq yes
+or
+.Dq no ,
+appropriately.
+.Pp
+Since making a dump involves a lot of time and effort for full dumps,
+.Nm
+checkpoints itself at the start of each tape volume.
+If writing that volume fails for some reason,
+.Nm
+will,
+with operator permission,
+restart itself from the checkpoint
+after the old tape has been rewound and removed,
+and a new tape has been mounted.
+.Pp
+.Nm Dump
+tells the operator what is going on at periodic intervals,
+including usually low estimates of the number of blocks to write,
+the number of tapes it will take, the time to completion, and
+the time to the tape change.
+The output is verbose,
+so that others know that the terminal
+controlling
+.Nm
+is busy,
+and will be for some time.
+.Pp
+In the event of a catastrophic disk event, the time required
+to restore all the necessary backup tapes or files to disk
+can be kept to a minimum by staggering the incremental dumps.
+An efficient method of staggering incremental dumps
+to minimize the number of tapes follows:
+.Bl -bullet -offset indent
+.It
+Always start with a level 0 backup, for example:
+.Bd -literal -offset indent
+/sbin/dump -0u -f /dev/st0 /usr/src
+.Ed
+.Pp
+This should be done at set intervals, say once a month or once every two months,
+and on a set of fresh tapes that is saved forever.
+.It
+After a level 0, dumps of active file
+systems are taken on a daily basis,
+using a modified Tower of Hanoi algorithm,
+with this sequence of dump levels:
+.Bd -literal -offset indent
+3 2 5 4 7 6 9 8 9 9 ...
+.Ed
+.Pp
+For the daily dumps, it should be possible to use a fixed number of tapes
+for each day, used on a weekly basis.
+Each week, a level 1 dump is taken, and
+the daily Hanoi sequence repeats beginning with 3.
+For weekly dumps, another fixed set of tapes per dumped file system is
+used, also on a cyclical basis.
+.El
+.Pp
+After several months or so, the daily and weekly tapes should get
+rotated out of the dump cycle and fresh tapes brought in.
+.Sh ENVIRONMENT
+.Bl -tag -width Fl
+.It Ev TAPE
+If no -f option was specified,
+.Nm
+will use the device specified via
+.Ev TAPE
+as the dump device.
+.Ev TAPE
+may be of the form
+.Qq tapename ,
+.Qq host:tapename ,
+or
+.Qq user@host:tapename .
+.It Ev RMT
+The environment variable
+.Ev RMT
+will be used to determine the pathname of the remote
+.Xr rmt 8
+program.
+.Sh FILES
+.Bl -tag -width __DUMPDATES__ -compact
+.It Pa /dev/st0
+default tape unit to dump to
+.It Pa __DUMPDATES__
+dump date records
+.It Pa /etc/fstab
+dump table: file systems and frequency
+.It Pa /etc/group
+to find group
+.Em operator
+.El
+.Sh SEE ALSO
+.Xr fstab 5 ,
+.Xr restore 8 ,
+.Xr rmt 8
+.Sh DIAGNOSTICS
+Many, and verbose.
+.Pp
+.Nm Dump
+exits with zero status on success.
+Startup errors are indicated with an exit code of 1;
+abnormal termination is indicated with an exit code of 3.
+.Sh BUGS
+It might be considered a bug that this version of dump can only handle ext2
+filesystems.  Specifically, it does not work with FAT filesystems.
+.Pp
+Fewer than 32 read errors on the filesystem are ignored. If noticing
+read errors is important, the output from dump can be parsed to look for lines
+that contain the text 'read error'.
+.Pp
+Each reel requires a new process, so parent processes for
+reels already written just hang around until the entire tape
+is written.
+.Pp
+.Nm Dump
+with the
+.Fl W
+or
+.Fl w
+option does not report filesystems that have never been recorded
+in
+.Pa __DUMPDATES__ ,
+even if listed in
+.Pa /etc/fstab .
+.Pp
+It would be nice if
+.Nm
+knew about the dump sequence,
+kept track of the tapes scribbled on,
+told the operator which tape to mount when,
+and provided more assistance
+for the operator running
+.Xr restore .
+.Pp
+.Nm Dump
+cannot do remote backups without being run as root, due to its
+security history.  This will be fixed in a later version of
+.Bx Free .
+Presently, it works if you set it setuid (like it used to be), but this
+might constitute a security risk.
+.Sh AUTHOR
+The 
+.Nm dump/restore
+backup suit was ported to Linux's Second Extended File System
+by Remy Card <card@Linux.EU.Org>. He maintained the initial versions
+of dump (up and including 0.4b4, released in january 1997).
+.Pp
+Starting with 0.4b5, the new maintainer is Stelian Pop 
+.br
+<pop@cybercable.fr>.
+.Sh AVAILABILITY
+The
+.Nm dump/restore
+backup suit is available for anonymous ftp from tsx-11.mit.edu
+in /pub/linux/ALPHA/ext2fs (development versions) or 
+/pub/linux/packages/ext2fs (stable versions).
+.Pp
+An alternate downloading location is http://perso.cybercable.fr/pop/dump.
+.Sh HISTORY
+A
+.Nm
+command appeared in
+.At v6 .
index 8424c719c0e727ac42adc33ec9b926f6b9f43ff8..ba7ed3833bda2ef98309f2f0389d9dfe13d69ea1 100644 (file)
@@ -208,8 +208,8 @@ struct      dumptime *dthead;       /* head of the list version */
 int    nddates;                /* number of records (might be zero) */
 int    ddates_in;              /* we have read the increment file */
 struct dumpdates **ddatev;     /* the arrayfied version */
 int    nddates;                /* number of records (might be zero) */
 int    ddates_in;              /* we have read the increment file */
 struct dumpdates **ddatev;     /* the arrayfied version */
-void   initdumptimes __P((void));
-void   getdumptime __P((void));
+void   initdumptimes __P((int));
+void   getdumptime __P((int));
 void   putdumptime __P((void));
 #define        ITITERATE(i, ddp) \
        for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
 void   putdumptime __P((void));
 #define        ITITERATE(i, ddp) \
        for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
@@ -229,7 +229,7 @@ extern int errno;
 #endif
 
 #ifdef __linux__
 #endif
 
 #ifdef __linux__
-#define        DUMP_CURRENT_REV        0
+#define        DUMP_CURRENT_REV        1
 #endif
 
 #ifndef        __linux__
 #endif
 
 #ifndef        __linux__
index a1b66f9a33ddf4194dd90ee933d2c59d3d0d8c8a..e29632cf75626cf721a38ab238d282f2bcbcd46c 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)itime.c    8.1 (Berkeley) 6/5/93";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)itime.c    8.1 (Berkeley) 6/5/93";
 #endif
 static const char rcsid[] =
-       "$Id: itime.c,v 1.3 1999/10/11 12:59:18 stelian Exp $";
+       "$Id: itime.c,v 1.4 1999/10/11 13:08:07 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -93,7 +93,7 @@ static        int makedumpdate __P((struct dumpdates *, char *));
 static void readdumptimes __P((FILE *));
 
 void
 static void readdumptimes __P((FILE *));
 
 void
-initdumptimes(void)
+initdumptimes(int createdumpdates)
 {
        FILE *df;
 
 {
        FILE *df;
 
@@ -103,25 +103,31 @@ initdumptimes(void)
                            strerror(errno));
                        /* NOTREACHED */
                }
                            strerror(errno));
                        /* NOTREACHED */
                }
-               /*
-                * Dumpdates does not exist, make an empty one.
-                */
-               msg("WARNING: no file `%s', making an empty one\n", dumpdates);
-               if ((df = fopen(dumpdates, "w")) == NULL) {
-                       quit("cannot create %s: %s\n", dumpdates,
-                           strerror(errno));
-                       /* NOTREACHED */
+               if (createdumpdates) {
+                       /*
+                        * Dumpdates does not exist, make an empty one.
+                        */
+                       msg("WARNING: no file `%s', making an empty one\n", dumpdates);
+                       if ((df = fopen(dumpdates, "w")) == NULL) {
+                               quit("cannot create %s: %s\n", dumpdates,
+                               strerror(errno));
+                               /* NOTREACHED */
+                       }
+                       (void) fclose(df);
+                       if ((df = fopen(dumpdates, "r")) == NULL) {
+                               quit("cannot read %s even after creating it: %s\n",
+                               dumpdates, strerror(errno));
+                               /* NOTREACHED */
+                       }
                }
                }
+               else
+                       msg("WARNING: no file `%s'\n", dumpdates);
+       }
+       if (df != NULL) {
+               (void) flock(fileno(df), LOCK_SH);
+               readdumptimes(df);
                (void) fclose(df);
                (void) fclose(df);
-               if ((df = fopen(dumpdates, "r")) == NULL) {
-                       quit("cannot read %s even after creating it: %s\n",
-                           dumpdates, strerror(errno));
-                       /* NOTREACHED */
-               }
        }
        }
-       (void) flock(fileno(df), LOCK_SH);
-       readdumptimes(df);
-       (void) fclose(df);
 }
 
 static void
 }
 
 static void
@@ -152,7 +158,7 @@ readdumptimes(FILE *df)
 }
 
 void
 }
 
 void
-getdumptime(void)
+getdumptime(int createdumpdates)
 {
        register struct dumpdates *ddp;
        register int i;
 {
        register struct dumpdates *ddp;
        register int i;
@@ -169,10 +175,11 @@ getdumptime(void)
        /* if we're not going to update dumpdates, there's no point in reading
           it, particularly since /var might not be mounted... wait until here
           to benefit from the initialization of variables needed by parent */
        /* if we're not going to update dumpdates, there's no point in reading
           it, particularly since /var might not be mounted... wait until here
           to benefit from the initialization of variables needed by parent */
-       if (uflag == 0)
+       if (!uflag && level == lastlevel)
+               return;
+       initdumptimes(createdumpdates);
+       if (ddatev == NULL)
                return;
                return;
-
-       initdumptimes();
        /*
         *      Go find the entry with the same name for a lower increment
         *      and older date
        /*
         *      Go find the entry with the same name for a lower increment
         *      and older date
index ca30a9c03483f9d97ded33f3388a479fb97241fe..58ff5c35ea87bd3fe9ac885236de59344d73495f 100644 (file)
@@ -50,7 +50,7 @@ static const char copyright[] =
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
-       "$Id: main.c,v 1.3 1999/10/11 12:59:18 stelian Exp $";
+       "$Id: main.c,v 1.4 1999/10/11 13:08:07 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -343,7 +343,6 @@ main(int argc, char *argv[])
                signal(SIGTERM, sig);
        if (signal(SIGINT, interrupt) == SIG_IGN)
                signal(SIGINT, SIG_IGN);
                signal(SIGTERM, sig);
        if (signal(SIGINT, interrupt) == SIG_IGN)
                signal(SIGINT, SIG_IGN);
-
        set_operators();        /* /etc/group snarfed */
        getfstab();             /* /etc/fstab snarfed */
        /*
        set_operators();        /* /etc/group snarfed */
        getfstab();             /* /etc/fstab snarfed */
        /*
@@ -394,10 +393,17 @@ main(int argc, char *argv[])
        spcl.c_level = level - '0';
        spcl.c_type = TS_TAPE;
        if (!Tflag)
        spcl.c_level = level - '0';
        spcl.c_type = TS_TAPE;
        if (!Tflag)
-               getdumptime();          /* dumpdates snarfed */
+               getdumptime(uflag);             /* dumpdates snarfed */
+
+       if (spcl.c_ddate == 0 && spcl.c_level) {
+               msg("WARNING: There is no inferior level dump on this filesystem\n"); 
+               msg("WARNING: Assuming a level 0 dump by default\n");
+               level = '0';
+               spcl.c_level = 0;
+       }
 
        msg("Date of this level %c dump: %s", level,
 
        msg("Date of this level %c dump: %s", level,
-#ifdef __linux
+#ifdef __linux__
                spcl.c_date == 0 ? "the epoch\n" : ctime4(&spcl.c_date));
 #else
                spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date));
                spcl.c_date == 0 ? "the epoch\n" : ctime4(&spcl.c_date));
 #else
                spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date));
@@ -550,7 +556,11 @@ main(int argc, char *argv[])
        "can't allocate tape buffers - try a smaller blocking factor.\n");
 
        startnewtape(1);
        "can't allocate tape buffers - try a smaller blocking factor.\n");
 
        startnewtape(1);
+#ifdef __linux__
+       (void)time4(&(tstart_writing));
+#else
        (void)time((time_t *)&(tstart_writing));
        (void)time((time_t *)&(tstart_writing));
+#endif
        dumpmap(usedinomap, TS_CLRI, maxino - 1);
 
        msg("dumping (Pass III) [directories]\n");
        dumpmap(usedinomap, TS_CLRI, maxino - 1);
 
        msg("dumping (Pass III) [directories]\n");
@@ -595,7 +605,11 @@ main(int argc, char *argv[])
                (void)dumpino(dp, ino);
        }
 
                (void)dumpino(dp, ino);
        }
 
+#ifdef __linux__
+       (void)time4(&(tend_writing));
+#else
        (void)time((time_t *)&(tend_writing));
        (void)time((time_t *)&(tend_writing));
+#endif
        spcl.c_type = TS_END;
        for (i = 0; i < ntrec; i++)
                writeheader(maxino - 1);
        spcl.c_type = TS_END;
        for (i = 0; i < ntrec; i++)
                writeheader(maxino - 1);
index 96b829af656f9c8e93d30b5a1d371cc73de2f8c0..ab38a3d9217e7046597fd3385cf7452d25b1b1e5 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)optr.c     8.2 (Berkeley) 1/6/94";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)optr.c     8.2 (Berkeley) 1/6/94";
 #endif
 static const char rcsid[] =
-       "$Id: optr.c,v 1.3 1999/10/11 12:59:19 stelian Exp $";
+       "$Id: optr.c,v 1.4 1999/10/11 13:08:08 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -60,6 +60,7 @@ static const char rcsid[] =
 #include <stdarg.h>
 #include <unistd.h>
 #include <utmp.h>
 #include <stdarg.h>
 #include <unistd.h>
 #include <utmp.h>
+#include <sys/stat.h>
 
 #ifdef __linux__
 #include <linux/ext2_fs.h>
 
 #ifdef __linux__
 #include <linux/ext2_fs.h>
@@ -97,7 +98,11 @@ query(const char *question)
        FILE    *mytty;
        time_t  firstprompt, when_answered;
 
        FILE    *mytty;
        time_t  firstprompt, when_answered;
 
-       firstprompt = time(NULL);
+#ifdef __linux__
+       (void)time4(&(firstprompt));
+#else
+       (void)time((time_t *)&(firstprompt));
+#endif
 
        if ((mytty = fopen(_PATH_TTY, "r")) == NULL)
                quit("fopen on %s fails: %s\n", _PATH_TTY, strerror(errno));
 
        if ((mytty = fopen(_PATH_TTY, "r")) == NULL)
                quit("fopen on %s fails: %s\n", _PATH_TTY, strerror(errno));
@@ -130,12 +135,16 @@ query(const char *question)
        if (signal(SIGALRM, sig) == SIG_IGN)
                signal(SIGALRM, SIG_IGN);
        (void) fclose(mytty);
        if (signal(SIGALRM, sig) == SIG_IGN)
                signal(SIGALRM, SIG_IGN);
        (void) fclose(mytty);
-       when_answered = time(NULL);
+#ifdef __linux__
+       (void)time4(&(when_answered));
+#else
+       (void)time((time_t *)&(when_answered));
+#endif
        /*
         * Adjust the base for time estimates to ignore time we spent waiting
         * for operator input.
         */
        /*
         * Adjust the base for time estimates to ignore time we spent waiting
         * for operator input.
         */
-       if (tstart_writing != 0)
+       if ((tstart_writing != 0) && (when_answered != (time_t)-1) && (firstprompt != (time_t)-1))
                tstart_writing += (when_answered - firstprompt);
        return(back);
 }
                tstart_writing += (when_answered - firstprompt);
        return(back);
 }
@@ -314,7 +323,11 @@ timeest(void)
 {
        time_t  tnow, deltat;
 
 {
        time_t  tnow, deltat;
 
+#ifdef __linux__
+       (void) time4(&tnow);
+#else
        (void) time((time_t *) &tnow);
        (void) time((time_t *) &tnow);
+#endif
        if (tnow >= tschedule) {
                tschedule = tnow + 300;
                if (blockswritten < 500)
        if (tnow >= tschedule) {
                tschedule = tnow + 300;
                if (blockswritten < 500)
@@ -501,6 +514,10 @@ fstabsearchdir(const char *key, char *directory)
        register struct fstab *fs;
        register struct fstab *found_fs = NULL;
        unsigned int size = 0;
        register struct fstab *fs;
        register struct fstab *found_fs = NULL;
        unsigned int size = 0;
+       struct stat buf;
+
+       if (stat(key, &buf) == 0 && S_ISBLK(buf.st_mode))
+               return NULL;
 
        for (pf = table; pf != NULL; pf = pf->pf_next) {
                fs = pf->pf_fstab;
 
        for (pf = table; pf != NULL; pf = pf->pf_next) {
                fs = pf->pf_fstab;
@@ -534,40 +551,42 @@ lastdump(char arg) /* w ==> just what to do; W ==> most recent dumps */
 {
        register int i;
        register struct fstab *dt;
 {
        register int i;
        register struct fstab *dt;
-       register struct dumpdates *dtwalk;
+       register struct dumpdates *dtwalk=NULL;
        char *lastname, *date;
        int dumpme;
        time_t tnow;
 
        (void) time(&tnow);
        getfstab();             /* /etc/fstab input */
        char *lastname, *date;
        int dumpme;
        time_t tnow;
 
        (void) time(&tnow);
        getfstab();             /* /etc/fstab input */
-       initdumptimes();        /* /etc/dumpdates input */
-       qsort((char *) ddatev, nddates, sizeof(struct dumpdates *), datesort);
-
-       if (arg == 'w')
-               (void) printf("Dump these file systems:\n");
-       else
-               (void) printf("Last dump(s) done (Dump '>' file systems):\n");
-       lastname = "??";
-       ITITERATE(i, dtwalk) {
-               if (strncmp(lastname, dtwalk->dd_name,
-                   sizeof(dtwalk->dd_name)) == 0)
-                       continue;
-               date = (char *)ctime(&dtwalk->dd_ddate);
-               date[16] = '\0';        /* blast away seconds and year */
-               lastname = dtwalk->dd_name;
-               dt = fstabsearch(dtwalk->dd_name);
-               dumpme = (dt != NULL &&
-                   dt->fs_freq != 0 &&
-                   dtwalk->dd_ddate < tnow - (dt->fs_freq * 86400));
-               if (arg != 'w' || dumpme)
-                       (void) printf(
-                           "%c %8s\t(%6s) Last dump: Level %c, Date %s\n",
-                           dumpme && (arg != 'w') ? '>' : ' ',
-                           dtwalk->dd_name,
-                           dt ? dt->fs_file : "",
-                           dtwalk->dd_level,
-                           date);
+       initdumptimes(0);       /* dumpdates input */
+       if (ddatev != NULL) {
+               qsort((char *) ddatev, nddates, sizeof(struct dumpdates *), datesort);
+
+               if (arg == 'w')
+                       (void) printf("Dump these file systems:\n");
+               else
+                       (void) printf("Last dump(s) done (Dump '>' file systems):\n");
+               lastname = "??";
+               ITITERATE(i, dtwalk) {
+                       if (strncmp(lastname, dtwalk->dd_name,
+                               sizeof(dtwalk->dd_name)) == 0)
+                               continue;
+                       date = (char *)ctime(&dtwalk->dd_ddate);
+                       date[16] = '\0';        /* blast away seconds and year */
+                       lastname = dtwalk->dd_name;
+                       dt = fstabsearch(dtwalk->dd_name);
+                       dumpme = (dt != NULL &&
+                               dt->fs_freq != 0 &&
+                               dtwalk->dd_ddate < tnow - (dt->fs_freq * 86400));
+                       if (arg != 'w' || dumpme)
+                               (void) printf(
+                                       "%c %8s\t(%6s) Last dump: Level %c, Date %s\n",
+                                       dumpme && (arg != 'w') ? '>' : ' ',
+                                       dtwalk->dd_name,
+                                       dt ? dt->fs_file : "",
+                                       dtwalk->dd_level,
+                                       date);
+               }
        }
 }
 
        }
 }
 
index b48665ef0e274e4732598a4bc9df8160b298ab1c..741f2de25ad442a1fcf58cd183beea2945662556 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)tape.c     8.4 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)tape.c     8.4 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
-       "$Id: tape.c,v 1.3 1999/10/11 12:59:19 stelian Exp $";
+       "$Id: tape.c,v 1.4 1999/10/11 13:08:08 stelian Exp $";
 #endif /* not lint */
 
 #ifdef __linux__
 #endif /* not lint */
 
 #ifdef __linux__
@@ -270,10 +270,19 @@ do_stats(void)
        time_t tnow, ttaken;
        int blocks;
 
        time_t tnow, ttaken;
        int blocks;
 
+#ifdef __linux__
+       (void)time4(&tnow);
+#else
        (void)time(&tnow);
        (void)time(&tnow);
+#endif
        ttaken = tnow - tstart_volume;
        blocks = spcl.c_tapea - tapea_volume;
        ttaken = tnow - tstart_volume;
        blocks = spcl.c_tapea - tapea_volume;
-       msg("Volume %d completed at: %s", tapeno, ctime(&tnow));
+       msg("Volume %d completed at: %s", tapeno, 
+#ifdef __linux__
+                                         ctime4(&tnow));
+#else
+                                         ctime(&tnow));
+#endif
        if (ttaken > 0) {
                msg("Volume %d took %d:%02d:%02d\n", tapeno,
                        ttaken / 3600, (ttaken % 3600) / 60, ttaken % 60);
        if (ttaken > 0) {
                msg("Volume %d took %d:%02d:%02d\n", tapeno,
                        ttaken / 3600, (ttaken % 3600) / 60, ttaken % 60);
@@ -299,7 +308,11 @@ statussig(int notused)
 
        if (blockswritten < 500)
                return;
 
        if (blockswritten < 500)
                return;
+#ifdef __linux__
+       (void) time4(&tnow);
+#else
        (void) time((time_t *) &tnow);
        (void) time((time_t *) &tnow);
+#endif
        deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing))
                / blockswritten * tapesize;
        (void)snprintf(msgbuf, sizeof(msgbuf),
        deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing))
                / blockswritten * tapesize;
        (void)snprintf(msgbuf, sizeof(msgbuf),
@@ -445,17 +458,10 @@ trewind(void)
 void
 close_rewind(void)
 {
 void
 close_rewind(void)
 {
-       time_t tstart_changevol, tend_changevol;
-
        trewind();
        (void)do_stats();
        if (nexttape)
                return;
        trewind();
        (void)do_stats();
        if (nexttape)
                return;
-#ifdef  __linux__
-        (void)time4(&(tstart_changevol));
-#else
-       (void)time((time_t *)&(tstart_changevol));
-#endif
        if (!nogripe) {
                msg("Change Volumes: Mount volume #%d\n", tapeno+1);
                broadcast("CHANGE DUMP VOLUMES!\7\7\n");
        if (!nogripe) {
                msg("Change Volumes: Mount volume #%d\n", tapeno+1);
                broadcast("CHANGE DUMP VOLUMES!\7\7\n");
@@ -465,13 +471,6 @@ close_rewind(void)
                        dumpabort(0);
                        /*NOTREACHED*/
                }
                        dumpabort(0);
                        /*NOTREACHED*/
                }
-#ifdef  __linux__
-       (void)time4(&(tend_changevol));
-#else
-       (void)time((time_t *)&(tend_changevol));
-#endif
-       if ((tstart_changevol != (time_t)-1) && (tend_changevol != (time_t)-1))
-               tstart_writing += (tend_changevol - tstart_changevol);
 }
 
 void
 }
 
 void
@@ -637,7 +636,11 @@ startnewtape(int top)
        interrupt_save = signal(SIGINT, SIG_IGN);
        parentpid = getpid();
        tapea_volume = spcl.c_tapea;
        interrupt_save = signal(SIGINT, SIG_IGN);
        parentpid = getpid();
        tapea_volume = spcl.c_tapea;
-       (void)time(&tstart_volume);
+#ifdef __linux__
+       (void)time4(&tstart_volume);
+#else
+       (void)time((&tstart_volume);
+#endif
 
 restore_check_point:
        (void)signal(SIGINT, interrupt_save);
 
 restore_check_point:
        (void)signal(SIGINT, interrupt_save);
@@ -750,7 +753,12 @@ restore_check_point:
                spcl.c_flags |= DR_NEWHEADER;
                writeheader((ino_t)slp->inode);
                spcl.c_flags &=~ DR_NEWHEADER;
                spcl.c_flags |= DR_NEWHEADER;
                writeheader((ino_t)slp->inode);
                spcl.c_flags &=~ DR_NEWHEADER;
-               msg("Volume %d started at: %s", tapeno, ctime(&tstart_volume));
+               msg("Volume %d started at: %s", tapeno, 
+#ifdef __linux__
+                                               ctime4(&tstart_volume));
+#else
+                                               ctime(&tstart_volume));
+#endif
                if (tapeno > 1)
                        msg("Volume %d begins with blocks from inode %d\n",
                                tapeno, slp->inode);
                if (tapeno > 1)
                        msg("Volume %d begins with blocks from inode %d\n",
                                tapeno, slp->inode);
index 59ce524c4c52495aa23e6a5ecf21cd548f2ba644..d408993808d379feaf52ce3d5c58f1d577e1a05b 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)traverse.c 8.7 (Berkeley) 6/15/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)traverse.c 8.7 (Berkeley) 6/15/95";
 #endif
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.3 1999/10/11 12:59:19 stelian Exp $";
+       "$Id: traverse.c,v 1.4 1999/10/11 13:08:08 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -338,7 +338,7 @@ mapdirs(ino_t maxino, long *tapesize)
        register int isdir;
        register char *map;
        register ino_t ino;
        register int isdir;
        register char *map;
        register ino_t ino;
-#ifndef __linux
+#ifndef __linux__
        register int i;
        long filesize;
 #endif
        register int i;
        long filesize;
 #endif
index bd724533f32d439449619d858811233b6eb8b68e..ec0960f16529a538a70c6f0e5e4b71181a58c55c 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)unctime.c  8.2 (Berkeley) 6/14/94";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)unctime.c  8.2 (Berkeley) 6/14/94";
 #endif
 static const char rcsid[] =
-       "$Id: unctime.c,v 1.3 1999/10/11 12:59:19 stelian Exp $";
+       "$Id: unctime.c,v 1.4 1999/10/11 13:08:08 stelian Exp $";
 #endif /* not lint */
 
 #include <time.h>
 #endif /* not lint */
 
 #include <time.h>
index e032d18b2d7fda35b5edfbffee7fdded98647f08..d8257fd86db44dc0462cacb196176a3306daa4af 100644 (file)
@@ -17,12 +17,16 @@ OBJS=               dirs.o interactive.o main.o restore.o symtab.o tape.o \
 MAN8=          restore.8
 MLINKS=                restore.8 $(MANDIR)/rrestore.8
 
 MAN8=          restore.8
 MLINKS=                restore.8 $(MANDIR)/rrestore.8
 
-all::          $(PROG)
+all::          $(PROG) restore.8
 
 $(PROG):       $(OBJS) $(DEPLIBS)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)
 
 
 $(PROG):       $(OBJS) $(DEPLIBS)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)
 
-install::      $(PROG)
+restore.8:     restore.8.in
+       sed -e "s|__DATE__|$(DATE)|g" \
+           -e "s|__VERSION__|$(VERSION)|g" $< > $@
+
+install::      all
        $(INSTALLBIN) $(PROG) $(BINDIR)
        $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR)
        @set $(LINKS) $(MLINKS); \
        $(INSTALLBIN) $(PROG) $(BINDIR)
        $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR)
        @set $(LINKS) $(MLINKS); \
@@ -37,7 +41,7 @@ install::     $(PROG)
        done; true
 
 clean::
        done; true
 
 clean::
-       $(RM) -f $(PROG) \#* *.s *.o *.a *~ core
+       $(RM) -f $(PROG) \#* *.s *.o *.a *~ core restore.8
 
 distclean::    clean
        $(RM) -f Makefile Makefile.old .depend
 
 distclean::    clean
        $(RM) -f Makefile Makefile.old .depend
index 30cec66e4a88a0df239ac1eb2ad38b0fd3a22591..a6611c678d14a9845a98c186ee6867126f44ce2d 100644 (file)
@@ -49,7 +49,7 @@
 static char sccsid[] = "@(#)dirs.c     8.7 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)dirs.c     8.7 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
-       "$Id: dirs.c,v 1.3 1999/10/11 12:59:19 stelian Exp $";
+       "$Id: dirs.c,v 1.4 1999/10/11 13:08:08 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -658,10 +658,11 @@ setdirmodes(int flags)
                        cp = myname(ep);
                        (void) chown(cp, node.uid, node.gid);
                        (void) chmod(cp, node.mode);
                        cp = myname(ep);
                        (void) chown(cp, node.uid, node.gid);
                        (void) chmod(cp, node.mode);
+                       if (node.flags)
 #ifdef __linux__
 #ifdef __linux__
-                       (void) setflags(cp, node.flags);
+                               (void) fsetflags(cp, node.flags);
 #else
 #else
-                       (void) chflags(cp, node.flags);
+                               (void) chflags(cp, node.flags);
 #endif
                        utimes(cp, node.timep);
                        ep->e_flags &= ~NEW;
 #endif
                        utimes(cp, node.timep);
                        ep->e_flags &= ~NEW;
index 8d8740bcdd0ca62ab47fe7808f273d6548b83773..46e6cc22eb507a1617fdced2047b7bdaf5b088e8 100644 (file)
@@ -39,7 +39,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)extern.h    8.2 (Berkeley) 1/7/94
  * SUCH DAMAGE.
  *
  *     @(#)extern.h    8.2 (Berkeley) 1/7/94
- *     $Id: extern.h,v 1.3 1999/10/11 12:59:20 stelian Exp $
+ *     $Id: extern.h,v 1.4 1999/10/11 13:08:09 stelian Exp $
  */
 
 struct entry   *addentry __P((char *, ino_t, int));
  */
 
 struct entry   *addentry __P((char *, ino_t, int));
@@ -119,3 +119,7 @@ int         rmtioctl __P((int, int));
 int            rmtopen __P((const char *, int));
 int            rmtread __P((const char *, int));
 int            rmtseek __P((int, int));
 int            rmtopen __P((const char *, int));
 int            rmtread __P((const char *, int));
 int            rmtseek __P((int, int));
+
+/* From e2fsprogs */
+int fsetflags __P((const char *, unsigned long));
+int setflags __P((int, unsigned long));
index de958bb34ce3547f26a9062303d5d43261b923e4..2f262789632fe1cf351d5f85cadccbbda228edb0 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)interactive.c      8.5 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)interactive.c      8.5 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
-       "$Id: interactive.c,v 1.3 1999/10/11 12:59:20 stelian Exp $";
+       "$Id: interactive.c,v 1.4 1999/10/11 13:08:09 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -561,12 +561,12 @@ printlist(char *name, char *basename)
                             strcmp(dp->d_name, "..") == 0))
                                continue;
                        locname[namelen] = '\0';
                             strcmp(dp->d_name, "..") == 0))
                                continue;
                        locname[namelen] = '\0';
-                       if (namelen + dp->d_namlen >= MAXPATHLEN) {
+                       if (namelen + strlen(dp->d_name) >= MAXPATHLEN) {
                                fprintf(stderr, "%s%s: name exceeds %d char\n",
                                        locname, dp->d_name, MAXPATHLEN);
                        } else {
                                (void) strncat(locname, dp->d_name,
                                fprintf(stderr, "%s%s: name exceeds %d char\n",
                                        locname, dp->d_name, MAXPATHLEN);
                        } else {
                                (void) strncat(locname, dp->d_name,
-                                   (int)dp->d_namlen);
+                                   (int)strlen(dp->d_name));
                                mkentry(locname, dp, listp++);
                                entries++;
                        }
                                mkentry(locname, dp, listp++);
                                entries++;
                        }
@@ -633,9 +633,12 @@ mkentry(char *name, struct direct *dp, struct afile *fp)
                fp->postfix = '#';
                break;
 
                fp->postfix = '#';
                break;
 
+#ifndef __linux__
+       /* no need for this */
        case DT_WHT:
                fp->postfix = '%';
                break;
        case DT_WHT:
                fp->postfix = '%';
                break;
+#endif
 
        case DT_UNKNOWN:
        case DT_DIR:
 
        case DT_UNKNOWN:
        case DT_DIR:
@@ -717,26 +720,20 @@ formatf(struct afile *list, int nentry)
  * Skip over directory entries that are not on the tape
  *
  * First have to get definition of a dirent.
  * Skip over directory entries that are not on the tape
  *
  * First have to get definition of a dirent.
+ *
+ * For Linux the dirent struct is now included from bsdcompat.h
  */
  */
-#ifdef __linux__
-struct dirent {
-       off_t           d_off;          /* offset of next disk dir entry */
-        unsigned long   d_fileno;       /* file number of entry */
-        unsigned short  d_reclen;       /* length of this record */
-        unsigned short  d_namlen;       /* length of string in d_name */
-        char            d_name[255+1];  /* name (up to MAXNAMLEN + 1) */
-};
-#else  /* __linux__ */
+#ifndef        __linux__
 #undef DIRBLKSIZ
 #include <dirent.h>
 #undef d_ino
 #undef DIRBLKSIZ
 #include <dirent.h>
 #undef d_ino
-#endif /* __linux__ */
+#endif /* __linux__ */
 
 struct dirent *
 glob_readdir(RST_DIR *dirp)
 {
        struct direct *dp;
 
 struct dirent *
 glob_readdir(RST_DIR *dirp)
 {
        struct direct *dp;
-       static struct dirent adirent;
+       static struct dirent adirent; 
 
        while ((dp = rst_readdir(dirp)) != NULL) {
                if (!vflag && dp->d_ino == WINO)
 
        while ((dp = rst_readdir(dirp)) != NULL) {
                if (!vflag && dp->d_ino == WINO)
@@ -747,7 +744,6 @@ glob_readdir(RST_DIR *dirp)
        if (dp == NULL)
                return (NULL);
        adirent.d_fileno = dp->d_ino;
        if (dp == NULL)
                return (NULL);
        adirent.d_fileno = dp->d_ino;
-       adirent.d_namlen = dp->d_namlen;
        memmove(adirent.d_name, dp->d_name, dp->d_namlen + 1);
        return (&adirent);
 }
        memmove(adirent.d_name, dp->d_name, dp->d_namlen + 1);
        return (&adirent);
 }
@@ -759,7 +755,6 @@ static int
 glob_stat(const char *name, struct stat *stp)
 {
        register struct direct *dp;
 glob_stat(const char *name, struct stat *stp)
 {
        register struct direct *dp;
-
        dp = pathsearch(name);
        if (dp == NULL || (!dflag && TSTINO(dp->d_ino, dumpmap) == 0) ||
            (!vflag && dp->d_ino == WINO))
        dp = pathsearch(name);
        if (dp == NULL || (!dflag && TSTINO(dp->d_ino, dumpmap) == 0) ||
            (!vflag && dp->d_ino == WINO))
index f979560c0a3a5853cd13d1a227d125ffbd81d14b..7460d7dd3903075bcff685e49565a4f9e7e0c739 100644 (file)
@@ -50,7 +50,7 @@ static const char copyright[] =
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 5/4/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 5/4/95";
 #endif
 static const char rcsid[] =
-       "$Id: main.c,v 1.3 1999/10/11 12:59:20 stelian Exp $";
+       "$Id: main.c,v 1.4 1999/10/11 13:08:09 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -361,12 +361,17 @@ main(int argc, char *argv[])
 static void
 usage(void)
 {
 static void
 usage(void)
 {
+#ifdef KERBEROS
+#define kerbflag "k"
+#else
+#define kerbflag
+#endif
        (void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n",
        (void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n",
-         "restore -i [-chkmuvy] [-b blocksize] [-f file] [-s fileno]",
-         "restore -r [-ckuvy] [-b blocksize] [-f file] [-s fileno]",
-         "restore -R [-ckuvy] [-b blocksize] [-f file] [-s fileno]",
-         "restore -x [-chkmuvy] [-b blocksize] [-f file] [-s fileno] [file ...]",
-         "restore -t [-chkuvy] [-b blocksize] [-f file] [-s fileno] [file ...]");
+         "restore -i [-ch" kerbflag "muvy] [-b blocksize] [-f file] [-s fileno]",
+         "restore -r [-c" kerbflag "uvy] [-b blocksize] [-f file] [-s fileno]",
+         "restore -R [-c" kerbflag "uvy] [-b blocksize] [-f file] [-s fileno]",
+         "restore -x [-ch" kerbflag "muvy] [-b blocksize] [-f file] [-s fileno] [file ...]",
+         "restore -t [-ch" kerbflag "kuvy] [-b blocksize] [-f file] [-s fileno] [file ...]");
        exit(1);
 }
 
        exit(1);
 }
 
diff --git a/restore/restore.8 b/restore/restore.8
deleted file mode 100644 (file)
index 676e3c4..0000000
+++ /dev/null
@@ -1,543 +0,0 @@
-.\" Copyright (c) 1985, 1991, 1993
-.\"    The Regents of the University of California.  All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"    This product includes software developed by the University of
-.\"    California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"     @(#)restore.8  8.4 (Berkeley) 5/1/95
-.\"    $Id: restore.8,v 1.3 1999/10/11 12:59:20 stelian Exp $
-.\"
-.Dd May 1, 1995
-.Dt RESTORE 8
-.Os BSD 4
-.Sh NAME
-.Nm restore
-.Nd "restore files or file systems from backups made with dump"
-.Sh SYNOPSIS
-.Nm restore
-.Fl C
-.Op Fl ckvy
-.Op Fl b Ar blocksize
-.Op Fl D Ar filesystem
-.Op Fl f Ar file
-.Op Fl s Ar fileno
-.Op Fl T Ar directory
-.Nm restore
-.Fl i
-.Op Fl chkmNuvy
-.Op Fl b Ar blocksize
-.Op Fl f Ar file
-.Op Fl s Ar fileno
-.Op Fl T Ar directory
-.Nm restore
-.Fl R
-.Op Fl ckNuvy
-.Op Fl b Ar blocksize
-.Op Fl f Ar file
-.Op Fl s Ar fileno
-.Op Fl T Ar directory
-.Nm restore
-.Fl r
-.Op Fl ckNuvy
-.Op Fl b Ar blocksize
-.Op Fl f Ar file
-.Op Fl s Ar fileno
-.Op Fl T Ar directory
-.Nm restore
-.Fl t
-.Op Fl chkNuvy
-.Op Fl b Ar blocksize
-.Op Fl f Ar file
-.Op Fl s Ar fileno
-.Op Fl T Ar directory
-.Op file ...
-.Nm restore
-.Fl x
-.Op Fl chkmNuvy
-.Op Fl b Ar blocksize
-.Op Fl f Ar file
-.Op Fl s Ar fileno
-.Op Fl T Ar directory
-.Op file ...
-.Pp
-.in -\\n(iSu
-(The
-.Bx 4.3
-option syntax is implemented for backward compatibility but
-is not documented here.)
-.Sh DESCRIPTION
-The
-.Nm restore
-command performs the inverse function of
-.Xr dump 8 .
-A full backup of a file system may be restored and
-subsequent incremental backups layered on top of it.
-Single files and
-directory subtrees may be restored from full or partial
-backups.
-.Nm Restore
-works across a network;
-to do this see the
-.Fl f
-flag described below.
-Other arguments to the command are file or directory
-names specifying the files that are to be restored.
-Unless the
-.Fl h
-flag is specified (see below),
-the appearance of a directory name refers to
-the files and (recursively) subdirectories of that directory.
-.Pp
-Exactly one of the following flags is required:
-.Bl -tag -width Ds
-.It Fl C
-This mode allows comparison of files from a dump.
-.Nm Restore
-reads the backup and compares its contents with files present on the
-disk.
-It first changes its working directory to the root of the filesystem
-that was dumped and compares the tape with the files in its new
-current directory.
-.It Fl i
-This mode allows interactive restoration of files from a dump.
-After reading in the directory information from the dump,
-.Nm restore
-provides a shell like interface that allows the user to move
-around the directory tree selecting files to be extracted.
-The available commands are given below;
-for those commands that require an argument,
-the default is the current directory.
-.Bl -tag -width Fl
-.It Ic add Op Ar arg
-The current directory or specified argument is added to the list of
-files to be extracted.
-If a directory is specified, then it and all its descendents are
-added to the extraction list
-(unless the
-.Fl h
-flag is specified on the command line).
-Files that are on the extraction list are prepended with a
-.Dq \&*
-when they are listed by 
-.Ic ls .
-.It Ic \&cd Ar arg
-Change the current working directory to the specified argument.
-.It Ic delete Op Ar arg
-The current directory or specified argument is deleted from the list of
-files to be extracted.
-If a directory is specified, then it and all its descendents are
-deleted from the extraction list
-(unless the
-.Fl h
-flag is specified on the command line).
-The most expedient way to extract most of the files from a directory 
-is to add the directory to the extraction list and then delete
-those files that are not needed.
-.It Ic extract
-All files on the extraction list are extracted
-from the dump.
-.Nm Restore
-will ask which volume the user wishes to mount.
-The fastest way to extract a few files is to
-start with the last volume and work towards the first volume.
-.It Ic help
-List a summary of the available commands.
-.It Ic \&ls Op Ar arg
-List the current or specified directory.
-Entries that are directories are appended with a
-.Dq \&* .
-Entries that have been marked for extraction are prepended with a ``*''.
-If the verbose
-flag is set, the inode number of each entry is also listed.
-.It Ic pwd
-Print the full pathname of the current working directory.
-.It Ic quit
-Restore immediately exits,
-even if the extraction list is not empty.
-.It Ic setmodes
-All directories that have been added to the extraction list
-have their owner, modes, and times set;
-nothing is extracted from the dump.
-This is useful for cleaning up after a restore has been prematurely aborted.
-.It Ic verbose
-The sense of the 
-.Fl v
-flag is toggled.
-When set, the verbose flag causes the 
-.Ic ls
-command to list the inode numbers of all entries.
-It also causes
-.Nm restore
-to print out information about each file as it is extracted.
-.El
-.It Fl R
-.Nm Restore
-requests a particular tape of a multi-volume set on which to restart
-a full restore
-(see the
-.Fl r
-flag below).
-This is useful if the restore has been interrupted.
-.It Fl r
-Restore (rebuild) a file system.
-The target file system should be made pristine with
-.Xr newfs 8 ,
-mounted, and the user
-.Xr cd Ns 'd
-into the pristine file system
-before starting the restoration of the initial level 0 backup. If the
-level 0 restores successfully, the
-.Fl r
-flag may be used to restore
-any necessary incremental backups on top of the level 0.
-The
-.Fl r
-flag precludes an interactive file extraction and can be
-detrimental to one's health (not to mention the disk) if not used carefully.
-An example:
-.Bd -literal -offset indent
-newfs /dev/rrp0g eagle
-mount /dev/rp0g /mnt
-cd /mnt
-
-restore rf /dev/rst8
-.Ed
-.Pp
-Note that 
-.Nm restore
-leaves a file 
-.Pa restoresymtable
-in the root directory to pass information between incremental
-restore passes.
-This file should be removed when the last incremental has been
-restored.
-.Pp
-.Nm Restore ,
-in conjunction with
-.Xr newfs 8
-and
-.Xr dump 8 ,
-may be used to modify file system parameters
-such as size or block size.
-.It Fl t
-The names of the specified files are listed if they occur
-on the backup.
-If no file argument is given,
-the root directory is listed,
-which results in the entire content of the
-backup being listed,
-unless the
-.Fl h
-flag has been specified.
-Note that the
-.Fl t
-flag replaces the function of the old
-.Xr dumpdir 8
-program.
-.ne 1i
-.It Fl x
-The named files are read from the given media.
-If a named file matches a directory whose contents 
-are on the backup
-and the
-.Fl h
-flag is not specified,
-the directory is recursively extracted.
-The owner, modification time,
-and mode are restored (if possible).
-If no file argument is given,
-the root directory is extracted,
-which results in the entire content of the
-backup being extracted,
-unless the
-.Fl h
-flag has been specified.
-.El
-.Pp
-The following additional options may be specified:
-.Bl -tag -width Ds
-.It Fl b Ar blocksize
-The number of kilobytes per dump record.
-If the
-.Fl b
-option is not specified,
-.Nm restore
-tries to determine the media block size dynamically.
-.It Fl c
-Normally,
-.Nm restore
-will try to determine dynamically whether the dump was made from an
-old (pre-4.4) or new format file system.  The
-.Fl c
-flag disables this check, and only allows reading a dump in the old
-format.
-.It Fl D Ar filesystem
-The
-.Fl D
-flag allows the user to specify the filesystem name when using
-.Nm restore
-with the
-.Fl C
-option to check the backup.
-.It Fl f Ar file
-Read the backup from
-.Ar file ;
-.Ar file
-may be a special device file
-like
-.Pa /dev/st0
-(a tape drive),
-.Pa /dev/rsd1c
-(a disk drive),
-an ordinary file,
-or
-.Ql Fl
-(the standard input).
-If the name of the file is of the form
-.Dq host:file 
-or
-.Dq user@host:file ,
-.Nm restore
-reads from the named file on the remote host using
-.Xr rmt 8 .
-.Pp
-.It Fl k
-Use Kerberos authentication when contacting the remote tape server.
-(Only available if this options was enabled when
-.Nm restore
-was compiled.)
-.Pp
-.It Fl h
-Extract the actual directory, 
-rather than the files that it references.
-This prevents hierarchical restoration of complete subtrees
-from the dump.
-.It Fl m
-Extract by inode numbers rather than by file name.
-This is useful if only a few files are being extracted,
-and one wants to avoid regenerating the complete pathname
-to the file.
-.It Fl N
-The
-.Fl N
-flag causes
-.Nm restore to only print file names. Files are not extracted.
-.It Fl s Ar fileno
-Read from the specified
-.Ar fileno
-on a multi-file tape.
-File numbering starts at 1.
-.It Fl T Ar directory
-The
-.Fl T
-flag allows the user to specify a directory to use for the storage of
-temporary files. The default value is /tmp. This flag is most useful
-when restoring files after having booted from a floppy.  There might be little
-or no space on the floppy filesystem, but another source of space might exist.
-.It Fl u
-When creating certain types of files, restore may generate a warning
-diagnostic if they already exist in the target directory.
-To prevent this, the
-.Fl u
-(unlink) flag causes restore to remove old entries before attempting
-to create new ones.
-.It Fl v
-Normally
-.Nm restore
-does its work silently.
-The
-.Fl v
-(verbose)
-flag causes it to type the name of each file it treats
-preceded by its file type.
-.It Fl y
-Do not ask the user whether to abort the restore in the event of an error.
-Always try to skip over the bad block(s) and continue.
-.El
-.Sh DIAGNOSTICS
-Complains if it gets a read error.
-If 
-.Fl y
-has been specified, or the user responds
-.Ql y ,
-.Nm restore
-will attempt to continue the restore.
-.Pp
-If a backup was made using more than one tape volume,
-.Nm restore
-will notify the user when it is time to mount the next volume.
-If the
-.Fl x
-or
-.Fl i
-flag has been specified,
-.Nm restore
-will also ask which volume the user wishes to mount.
-The fastest way to extract a few files is to
-start with the last volume, and work towards the first volume.
-.Pp
-There are numerous consistency checks that can be listed by
-.Nm restore .
-Most checks are self-explanatory or can
-.Dq never happen .
-Common errors are given below.
-.Pp
-.Bl -tag -width Ds -compact
-.It Converting to new file system format
-A dump tape created from the old file system has been loaded.
-It is automatically converted to the new file system format.
-.Pp
-.It <filename>: not found on tape
-The specified file name was listed in the tape directory,
-but was not found on the tape.
-This is caused by tape read errors while looking for the file,
-and from using a dump tape created on an active file system.
-.Pp
-.It expected next file <inumber>, got <inumber>
-A file that was not listed in the directory showed up.
-This can occur when using a dump created on an active file system.
-.Pp
-.It Incremental dump too low
-When doing an incremental restore,
-a dump that was written before the previous incremental dump,
-or that has too low an incremental level has been loaded.
-.Pp
-.It Incremental dump too high
-When doing an incremental restore,
-a dump that does not begin its coverage where the previous incremental 
-dump left off,
-or that has too high an incremental level has been loaded.
-.Pp
-.It Tape read error while restoring <filename>
-.It Tape read error while skipping over inode <inumber>
-.It Tape read error while trying to resynchronize
-A tape (or other media) read error has occurred.
-If a file name is specified,
-its contents are probably partially wrong.
-If an inode is being skipped or the tape is trying to resynchronize,
-no extracted files have been corrupted,
-though files may not be found on the tape.
-.Pp
-.It resync restore, skipped <num> blocks
-After a dump read error, 
-.Nm restore
-may have to resynchronize itself.
-This message lists the number of blocks that were skipped over.
-.El
-.Sh ENVIRONMENT
-If the following environment variable exists it will be utilized by
-.Nm restore :
-.Pp
-.Bl -tag -width "TMPDIR" -compact
-.It Ev TAPE
-If no -f option was specified,
-.Nm
-will use the device specified via
-.Ev TAPE
-as the dump device.
-.Ev TAPE
-may be of the form
-.Qq tapename ,
-.Qq host:tapename
-or
-.Qq user@host:tapename .
-.It Ev TMPDIR
-The directory given in
-.Ev TMPDIR
-will be used
-instead of
-.Pa /tmp
-to store temporary files.
-.It Ev RMT
-The environment variable
-.Ev RMT
-will be used to determine the pathname of the remote
-.Xr rmt 8
-program.
-.Sh FILES
-.Bl -tag -width "./restoresymtable" -compact
-.It Pa /dev/st0
-the default tape drive
-.It Pa /tmp/rstdir*
-file containing directories on the tape
-.It Pa /tmp/rstmode*
-owner, mode, and time stamps for directories
-.It Pa \&./restoresymtable
-information passed between incremental restores
-.El
-.Sh SEE ALSO
-.Xr dump 8 ,
-.Xr mount 8 ,
-.Xr newfs 8 ,
-.Xr mkfs 8 ,
-.Xr rmt 8
-.Sh BUGS
-.Nm Restore
-can get confused when doing incremental restores from
-dumps that were made on active file systems.
-.Pp
-A level 0 dump must be done after a full restore.
-Because 
-.Nm restore
-runs in user code,
-it has no control over inode allocation;
-thus a full dump must be done to get a new set of directories
-reflecting the new inode numbering,
-even though the content of the files is unchanged.
-.Pp
-The temporary files
-.Pa /tmp/rstdir*
-and
-.Pa /tmp/rstmode*
-are generated with a unique name based on the date of the dump
-and the process ID (see
-.Xr mktemp 3 ),
-except when
-.Fl r
-or
-.Fl R
-is used.
-Because
-.Fl R
-allows you to restart a
-.Fl r
-operation that may have been interrupted, the temporary files should
-be the same across different processes.
-In all other cases, the files are unique because it is possible to
-have two different dumps started at the same time, and separate
-operations shouldn't conflict with each other.
-.Pp
-To do a network restore, you have to run restore as root.  This is due
-to the previous security history of dump and restore.  (restore is
-written to be setuid root, but we are not certain all bugs are gone
-from the restore code - run setuid at your own risk.)
-.Sh HISTORY
-The
-.Nm restore
-command appeared in
-.Bx 4.2 .
diff --git a/restore/restore.8.in b/restore/restore.8.in
new file mode 100644 (file)
index 0000000..5c12337
--- /dev/null
@@ -0,0 +1,560 @@
+.\" Copyright (c) 1985, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)restore.8  8.4 (Berkeley) 5/1/95
+.\"    $Id: restore.8.in,v 1.1 1999/10/11 13:08:09 stelian Exp $
+.\"
+.Dd __DATE__
+.Dt RESTORE 8
+.Os "__VERSION__"
+.Sh NAME
+.Nm restore
+.Nd "restore files or file systems from backups made with dump"
+.Sh SYNOPSIS
+.Nm restore
+.Fl C
+.Op Fl ckvy
+.Op Fl b Ar blocksize
+.Op Fl D Ar filesystem
+.Op Fl f Ar file
+.Op Fl s Ar fileno
+.Op Fl T Ar directory
+.Nm restore
+.Fl i
+.Op Fl chkmNuvy
+.Op Fl b Ar blocksize
+.Op Fl f Ar file
+.Op Fl s Ar fileno
+.Op Fl T Ar directory
+.Nm restore
+.Fl R
+.Op Fl ckNuvy
+.Op Fl b Ar blocksize
+.Op Fl f Ar file
+.Op Fl s Ar fileno
+.Op Fl T Ar directory
+.Nm restore
+.Fl r
+.Op Fl ckNuvy
+.Op Fl b Ar blocksize
+.Op Fl f Ar file
+.Op Fl s Ar fileno
+.Op Fl T Ar directory
+.Nm restore
+.Fl t
+.Op Fl chkNuvy
+.Op Fl b Ar blocksize
+.Op Fl f Ar file
+.Op Fl s Ar fileno
+.Op Fl T Ar directory
+.Op file ...
+.Nm restore
+.Fl x
+.Op Fl chkmNuvy
+.Op Fl b Ar blocksize
+.Op Fl f Ar file
+.Op Fl s Ar fileno
+.Op Fl T Ar directory
+.Op file ...
+.Pp
+.in
+(The
+.Bx 4.3
+option syntax is implemented for backward compatibility but
+is not documented here.)
+.Sh DESCRIPTION
+The
+.Nm restore
+command performs the inverse function of
+.Xr dump 8 .
+A full backup of a file system may be restored and
+subsequent incremental backups layered on top of it.
+Single files and
+directory subtrees may be restored from full or partial
+backups.
+.Nm Restore
+works across a network;
+to do this see the
+.Fl f
+flag described below.
+Other arguments to the command are file or directory
+names specifying the files that are to be restored.
+Unless the
+.Fl h
+flag is specified (see below),
+the appearance of a directory name refers to
+the files and (recursively) subdirectories of that directory.
+.Pp
+Exactly one of the following flags is required:
+.Bl -tag -width Ds
+.It Fl C
+This mode allows comparison of files from a dump.
+.Nm Restore
+reads the backup and compares its contents with files present on the
+disk.
+It first changes its working directory to the root of the filesystem
+that was dumped and compares the tape with the files in its new
+current directory.
+.It Fl i
+This mode allows interactive restoration of files from a dump.
+After reading in the directory information from the dump,
+.Nm restore
+provides a shell like interface that allows the user to move
+around the directory tree selecting files to be extracted.
+The available commands are given below;
+for those commands that require an argument,
+the default is the current directory.
+.Bl -tag -width Fl
+.It Ic add Op Ar arg
+The current directory or specified argument is added to the list of
+files to be extracted.
+If a directory is specified, then it and all its descendents are
+added to the extraction list
+(unless the
+.Fl h
+flag is specified on the command line).
+Files that are on the extraction list are prepended with a
+.Dq \&*
+when they are listed by 
+.Ic ls .
+.It Ic \&cd Ar arg
+Change the current working directory to the specified argument.
+.It Ic delete Op Ar arg
+The current directory or specified argument is deleted from the list of
+files to be extracted.
+If a directory is specified, then it and all its descendents are
+deleted from the extraction list
+(unless the
+.Fl h
+flag is specified on the command line).
+The most expedient way to extract most of the files from a directory 
+is to add the directory to the extraction list and then delete
+those files that are not needed.
+.It Ic extract
+All files on the extraction list are extracted
+from the dump.
+.Nm Restore
+will ask which volume the user wishes to mount.
+The fastest way to extract a few files is to
+start with the last volume and work towards the first volume.
+.It Ic help
+List a summary of the available commands.
+.It Ic \&ls Op Ar arg
+List the current or specified directory.
+Entries that are directories are appended with a
+.Dq \&* .
+Entries that have been marked for extraction are prepended with a ``*''.
+If the verbose
+flag is set, the inode number of each entry is also listed.
+.It Ic pwd
+Print the full pathname of the current working directory.
+.It Ic quit
+Restore immediately exits,
+even if the extraction list is not empty.
+.It Ic setmodes
+All directories that have been added to the extraction list
+have their owner, modes, and times set;
+nothing is extracted from the dump.
+This is useful for cleaning up after a restore has been prematurely aborted.
+.It Ic verbose
+The sense of the 
+.Fl v
+flag is toggled.
+When set, the verbose flag causes the 
+.Ic ls
+command to list the inode numbers of all entries.
+It also causes
+.Nm restore
+to print out information about each file as it is extracted.
+.El
+.It Fl R
+.Nm Restore
+requests a particular tape of a multi-volume set on which to restart
+a full restore
+(see the
+.Fl r
+flag below).
+This is useful if the restore has been interrupted.
+.It Fl r
+Restore (rebuild) a file system.
+The target file system should be made pristine with
+.Xr mke2fs 8 ,
+mounted, and the user
+.Xr cd Ns 'd
+into the pristine file system
+before starting the restoration of the initial level 0 backup. If the
+level 0 restores successfully, the
+.Fl r
+flag may be used to restore
+any necessary incremental backups on top of the level 0.
+The
+.Fl r
+flag precludes an interactive file extraction and can be
+detrimental to one's health (not to mention the disk) if not used carefully.
+An example:
+.Bd -literal -offset indent
+mke2fs /dev/sda1
+mount /dev/sda1 /mnt
+cd /mnt
+
+restore rf /dev/st0
+.Ed
+.Pp
+Note that 
+.Nm restore
+leaves a file 
+.Pa restoresymtable
+in the root directory to pass information between incremental
+restore passes.
+This file should be removed when the last incremental has been
+restored.
+.Pp
+.Nm Restore ,
+in conjunction with
+.Xr mke2fs 8
+and
+.Xr dump 8 ,
+may be used to modify file system parameters
+such as size or block size.
+.It Fl t
+The names of the specified files are listed if they occur
+on the backup.
+If no file argument is given,
+the root directory is listed,
+which results in the entire content of the
+backup being listed,
+unless the
+.Fl h
+flag has been specified.
+Note that the
+.Fl t
+flag replaces the function of the old
+.Xr dumpdir 8
+program.
+.ne 1i
+.It Fl x
+The named files are read from the given media.
+If a named file matches a directory whose contents 
+are on the backup
+and the
+.Fl h
+flag is not specified,
+the directory is recursively extracted.
+The owner, modification time,
+and mode are restored (if possible).
+If no file argument is given,
+the root directory is extracted,
+which results in the entire content of the
+backup being extracted,
+unless the
+.Fl h
+flag has been specified.
+.El
+.Pp
+The following additional options may be specified:
+.Bl -tag -width Ds
+.It Fl b Ar blocksize
+The number of kilobytes per dump record.
+If the
+.Fl b
+option is not specified,
+.Nm restore
+tries to determine the media block size dynamically.
+.It Fl c
+Normally,
+.Nm restore
+will try to determine dynamically whether the dump was made from an
+old (pre-4.4) or new format file system.  The
+.Fl c
+flag disables this check, and only allows reading a dump in the old
+format.
+.It Fl D Ar filesystem
+The
+.Fl D
+flag allows the user to specify the filesystem name when using
+.Nm restore
+with the
+.Fl C
+option to check the backup.
+.It Fl f Ar file
+Read the backup from
+.Ar file ;
+.Ar file
+may be a special device file
+like
+.Pa /dev/st0
+(a tape drive),
+.Pa /dev/sda1
+(a disk drive),
+an ordinary file,
+or
+.Ql Fl
+(the standard input).
+If the name of the file is of the form
+.Dq host:file 
+or
+.Dq user@host:file ,
+.Nm restore
+reads from the named file on the remote host using
+.Xr rmt 8 .
+.Pp
+.It Fl k
+Use Kerberos authentication when contacting the remote tape server.
+(Only available if this options was enabled when
+.Nm restore
+was compiled.)
+.Pp
+.It Fl h
+Extract the actual directory, 
+rather than the files that it references.
+This prevents hierarchical restoration of complete subtrees
+from the dump.
+.It Fl m
+Extract by inode numbers rather than by file name.
+This is useful if only a few files are being extracted,
+and one wants to avoid regenerating the complete pathname
+to the file.
+.It Fl N
+The
+.Fl N
+flag causes
+.Nm restore to only print file names. Files are not extracted.
+.It Fl s Ar fileno
+Read from the specified
+.Ar fileno
+on a multi-file tape.
+File numbering starts at 1.
+.It Fl T Ar directory
+The
+.Fl T
+flag allows the user to specify a directory to use for the storage of
+temporary files. The default value is /tmp. This flag is most useful
+when restoring files after having booted from a floppy.  There might be little
+or no space on the floppy filesystem, but another source of space might exist.
+.It Fl u
+When creating certain types of files, restore may generate a warning
+diagnostic if they already exist in the target directory.
+To prevent this, the
+.Fl u
+(unlink) flag causes restore to remove old entries before attempting
+to create new ones.
+.It Fl v
+Normally
+.Nm restore
+does its work silently.
+The
+.Fl v
+(verbose)
+flag causes it to type the name of each file it treats
+preceded by its file type.
+.It Fl y
+Do not ask the user whether to abort the restore in the event of an error.
+Always try to skip over the bad block(s) and continue.
+.El
+.Sh DIAGNOSTICS
+Complains if it gets a read error.
+If 
+.Fl y
+has been specified, or the user responds
+.Ql y ,
+.Nm restore
+will attempt to continue the restore.
+.Pp
+If a backup was made using more than one tape volume,
+.Nm restore
+will notify the user when it is time to mount the next volume.
+If the
+.Fl x
+or
+.Fl i
+flag has been specified,
+.Nm restore
+will also ask which volume the user wishes to mount.
+The fastest way to extract a few files is to
+start with the last volume, and work towards the first volume.
+.Pp
+There are numerous consistency checks that can be listed by
+.Nm restore .
+Most checks are self-explanatory or can
+.Dq never happen .
+Common errors are given below.
+.Pp
+.Bl -tag -width Ds -compact
+.It Converting to new file system format
+A dump tape created from the old file system has been loaded.
+It is automatically converted to the new file system format.
+.Pp
+.It <filename>: not found on tape
+The specified file name was listed in the tape directory,
+but was not found on the tape.
+This is caused by tape read errors while looking for the file,
+and from using a dump tape created on an active file system.
+.Pp
+.It expected next file <inumber>, got <inumber>
+A file that was not listed in the directory showed up.
+This can occur when using a dump created on an active file system.
+.Pp
+.It Incremental dump too low
+When doing an incremental restore,
+a dump that was written before the previous incremental dump,
+or that has too low an incremental level has been loaded.
+.Pp
+.It Incremental dump too high
+When doing an incremental restore,
+a dump that does not begin its coverage where the previous incremental 
+dump left off,
+or that has too high an incremental level has been loaded.
+.Pp
+.It Tape read error while restoring <filename>
+.It Tape read error while skipping over inode <inumber>
+.It Tape read error while trying to resynchronize
+A tape (or other media) read error has occurred.
+If a file name is specified,
+its contents are probably partially wrong.
+If an inode is being skipped or the tape is trying to resynchronize,
+no extracted files have been corrupted,
+though files may not be found on the tape.
+.Pp
+.It resync restore, skipped <num> blocks
+After a dump read error, 
+.Nm restore
+may have to resynchronize itself.
+This message lists the number of blocks that were skipped over.
+.El
+.Sh ENVIRONMENT
+If the following environment variable exists it will be utilized by
+.Nm restore :
+.Pp
+.Bl -tag -width "TMPDIR" -compact
+.It Ev TAPE
+If no -f option was specified,
+.Nm
+will use the device specified via
+.Ev TAPE
+as the dump device.
+.Ev TAPE
+may be of the form
+.Qq tapename ,
+.Qq host:tapename
+or
+.Qq user@host:tapename .
+.It Ev TMPDIR
+The directory given in
+.Ev TMPDIR
+will be used
+instead of
+.Pa /tmp
+to store temporary files.
+.It Ev RMT
+The environment variable
+.Ev RMT
+will be used to determine the pathname of the remote
+.Xr rmt 8
+program.
+.Sh FILES
+.Bl -tag -width "./restoresymtable" -compact
+.It Pa /dev/st0
+the default tape drive
+.It Pa /tmp/rstdir*
+file containing directories on the tape
+.It Pa /tmp/rstmode*
+owner, mode, and time stamps for directories
+.It Pa \&./restoresymtable
+information passed between incremental restores
+.El
+.Sh SEE ALSO
+.Xr dump 8 ,
+.Xr mount 8 ,
+.Xr mke2fs 8 ,
+.Xr rmt 8
+.Sh BUGS
+.Nm Restore
+can get confused when doing incremental restores from
+dumps that were made on active file systems.
+.Pp
+A level 0 dump must be done after a full restore.
+Because 
+.Nm restore
+runs in user code,
+it has no control over inode allocation;
+thus a full dump must be done to get a new set of directories
+reflecting the new inode numbering,
+even though the content of the files is unchanged.
+.Pp
+The temporary files
+.Pa /tmp/rstdir*
+and
+.Pa /tmp/rstmode*
+are generated with a unique name based on the date of the dump
+and the process ID (see
+.Xr mktemp 3 ),
+except when
+.Fl r
+or
+.Fl R
+is used.
+Because
+.Fl R
+allows you to restart a
+.Fl r
+operation that may have been interrupted, the temporary files should
+be the same across different processes.
+In all other cases, the files are unique because it is possible to
+have two different dumps started at the same time, and separate
+operations shouldn't conflict with each other.
+.Pp
+To do a network restore, you have to run restore as root.  This is due
+to the previous security history of dump and restore.  (restore is
+written to be setuid root, but we are not certain all bugs are gone
+from the restore code - run setuid at your own risk.)
+.Sh AUTHOR
+The
+.Nm dump/restore
+backup suit was ported to Linux's Second Extended File System
+by Remy Card <card@Linux.EU.Org>. He maintained the initial versions
+of dump (up and including 0.4b4, released in january 1997).
+.Pp
+Starting with 0.4b5, the new maintainer is Stelian Pop
+.br
+<pop@cybercable.fr>.
+.Sh AVAILABILITY
+The
+.Nm dump/restore
+backup suit is available for anonymous ftp from tsx-11.mit.edu
+in /pub/linux/ALPHA/ext2fs (development versions) or
+/pub/linux/packages/ext2fs (stable versions).
+.Pp
+An alternate downloading location is http://perso.cybercable.fr/pop/dump.
+.Sh HISTORY
+The
+.Nm restore
+command appeared in
+.Bx 4.2 .
index f1986a47b82030725fbdcea97337fbeacbb304e3..3eb6d93831a753606b4e78e410c489a9c52f0b27 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)restore.c  8.3 (Berkeley) 9/13/94";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)restore.c  8.3 (Berkeley) 9/13/94";
 #endif
 static const char rcsid[] =
-       "$Id: restore.c,v 1.3 1999/10/11 12:59:20 stelian Exp $";
+       "$Id: restore.c,v 1.4 1999/10/11 13:08:09 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
index 27343d9d319a3089471613f6c548e8fbad2832f1..275dd1cc8178add4888e5c9418a7e11eaa7a3394 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)symtab.c   8.3 (Berkeley) 4/28/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)symtab.c   8.3 (Berkeley) 4/28/95";
 #endif
 static const char rcsid[] =
-       "$Id: symtab.c,v 1.3 1999/10/11 12:59:20 stelian Exp $";
+       "$Id: symtab.c,v 1.4 1999/10/11 13:08:10 stelian Exp $";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
index 9e1e28c2594a70d94f4bc21ab66d49f34b9ca692..ab0513a919573bf06e0e31b63059c8bc4b098791 100644 (file)
@@ -49,7 +49,7 @@
 static char sccsid[] = "@(#)tape.c     8.9 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)tape.c     8.9 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
-       "$Id: tape.c,v 1.3 1999/10/11 12:59:21 stelian Exp $";
+       "$Id: tape.c,v 1.4 1999/10/11 13:08:10 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -602,10 +602,11 @@ extractfile(char *name)
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
+               if (flags)
 #ifdef  __linux__
 #ifdef  __linux__
-               (void) fsetflags(name, flags);
+                       (void) fsetflags(name, flags);
 #else
 #else
-               (void) chflags(name, flags);
+                       (void) chflags(name, flags);
 #endif
                skipfile();
                utimes(name, timep);
 #endif
                skipfile();
                utimes(name, timep);
@@ -627,10 +628,14 @@ extractfile(char *name)
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
+               if (flags)
 #ifdef __linux__
 #ifdef __linux__
-               (void) fsetflags(name, flags);
+                       {
+                       warn("%s: fsetflags called on a special file", name);
+                       (void) fsetflags(name, flags);
+                       }
 #else
 #else
-               (void) chflags(name, flags);
+                       (void) chflags(name, flags);
 #endif
                skipfile();
                utimes(name, timep);
 #endif
                skipfile();
                utimes(name, timep);
@@ -652,10 +657,11 @@ extractfile(char *name)
                }
                (void) fchown(ofile, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) fchmod(ofile, mode);
                }
                (void) fchown(ofile, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) fchmod(ofile, mode);
+               if (flags)
 #ifdef __linux__
 #ifdef __linux__
-               (void) fsetflags(ofile, flags);
+                       (void) setflags(ofile, flags);
 #else
 #else
-               (void) fchflags(ofile, flags);
+                       (void) fchflags(ofile, flags);
 #endif
                getfile(xtrfile, xtrskip);
                (void) close(ofile);
 #endif
                getfile(xtrfile, xtrskip);
                (void) close(ofile);
index 7c3bcd8b1dcbeb183fee5af349557a719ebd4aa6..1498599166bbe4b48e904839c7af3c14e7997a37 100644 (file)
@@ -44,7 +44,7 @@
 static char sccsid[] = "@(#)utilities.c        8.5 (Berkeley) 4/28/95";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)utilities.c        8.5 (Berkeley) 4/28/95";
 #endif
 static const char rcsid[] =
-       "$Id: utilities.c,v 1.3 1999/10/11 12:59:21 stelian Exp $";
+       "$Id: utilities.c,v 1.4 1999/10/11 13:08:10 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -157,7 +157,6 @@ void
 newnode(struct entry *np)
 {
        char *cp;
 newnode(struct entry *np)
 {
        char *cp;
-
        if (np->e_type != NODE)
                badentry(np, "newnode: not a node");
        cp = myname(np);
        if (np->e_type != NODE)
                badentry(np, "newnode: not a node");
        cp = myname(np);
index 973d9425adb1db318a0efd7a301924091e6b49e3..e1d44406837c61d453e205cd15c35d6c20371ffd 100644 (file)
@@ -18,17 +18,21 @@ SRCS=               rmt.c
 OBJS=          rmt.o
 MAN8=          rmt.8
 
 OBJS=          rmt.o
 MAN8=          rmt.8
 
-all::          $(PROG)
+all::          $(PROG) rmt.8
 
 $(PROG):       $(OBJS) $(DEPLIBS)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)
 
 
 $(PROG):       $(OBJS) $(DEPLIBS)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)
 
-install::      $(PROG)
+rmt.8:         rmt.8.in
+       sed -e "s|__DATE__|$(DATE)|g" \
+           -e "s|__VERSION__|$(VERSION)|g" $< > $@
+
+install::      all
        $(INSTALLBIN) $(PROG) $(BINDIR)
        $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR)
 
 clean::
        $(INSTALLBIN) $(PROG) $(BINDIR)
        $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR)
 
 clean::
-       rm -f $(PROG) \#* *.s *.o *.a *~ core
+       rm -f $(PROG) \#* *.s *.o *.a *~ core rmt.8
 
 distclean::    clean
        rm -f Makefile Makefile.old .depend 
 
 distclean::    clean
        rm -f Makefile Makefile.old .depend 
diff --git a/rmt/rmt.8 b/rmt/rmt.8
deleted file mode 100644 (file)
index 8f9d0df..0000000
--- a/rmt/rmt.8
+++ /dev/null
@@ -1,218 +0,0 @@
-.\" Copyright (c) 1983, 1991, 1993
-.\"    The Regents of the University of California.  All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"    This product includes software developed by the University of
-.\"    California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"     @(#)rmt.8      8.3 (Berkeley) 6/1/94
-.\"
-.Dd June 1, 1994
-.Dt RMT 8
-.Os BSD 4.2
-.Sh NAME
-.Nm rmt
-.Nd remote magtape protocol module
-.Sh SYNOPSIS
-.Nm rmt
-.Sh DESCRIPTION
-.Nm Rmt
-is a program used by the remote dump and restore programs
-in manipulating a magnetic tape drive through an interprocess
-communication connection.
-.Nm Rmt
-is normally started up with an
-.Xr rexec 3
-or
-.Xr rcmd 3
-call.
-.Pp
-The 
-.Nm
-program accepts requests specific to the manipulation of
-magnetic tapes, performs the commands, then responds with
-a status indication.  All responses are in
-.Tn ASCII
-and in
-one of two forms. 
-Successful commands have responses of:
-.Bd -filled -offset indent
-.Sm off
-.Sy A Ar number No \en
-.Sm on
-.Ed
-.Pp
-.Ar Number
-is an
-.Tn ASCII
-representation of a decimal number.
-Unsuccessful commands are responded to with:
-.Bd -filled -offset indent
-.Sm off
-.Xo Sy E Ar error-number
-.No \en Ar error-message
-.No \en
-.Xc
-.Sm on
-.Ed
-.Pp
-.Ar Error-number
-is one of the possible error
-numbers described in
-.Xr intro 2
-and
-.Ar error-message
-is the corresponding error string as printed
-from a call to
-.Xr perror 3 .
-The protocol is comprised of the
-following commands, which are sent as indicated - no spaces are supplied
-between the command and its arguments, or between its arguments, and
-.Ql \en
-indicates that a newline should be supplied:
-.Bl -tag -width Ds
-.Sm off
-.It Xo Sy \&O Ar device
-.No \en Ar mode No \en
-.Xc
-Open the specified 
-.Ar device
-using the indicated
-.Ar mode .
-.Ar Device
-is a full pathname and
-.Ar mode
-is an
-.Tn ASCII
-representation of a decimal
-number suitable for passing to
-.Xr open 2 .
-If a device had already been opened, it is
-closed before a new open is performed.
-.It Xo Sy C Ar device No \en
-.Xc
-Close the currently open device.  The
-.Ar device
-specified is ignored.
-.It Xo Sy L
-.Ar whence No \en
-.Ar offset No \en
-.Xc
-.Sm on
-Perform an
-.Xr lseek 2
-operation using the specified parameters.
-The response value is that returned from the
-.Xr lseek
-call.
-.Sm off
-.It Sy W Ar count No \en
-.Sm on
-Write data onto the open device.
-.Nm Rmt
-reads
-.Ar count
-bytes from the connection, aborting if
-a premature end-of-file is encountered.
-The response value is that returned from
-the
-.Xr write 2
-call.
-.Sm off
-.It Sy R Ar count No \en
-.Sm on
-Read
-.Ar count
-bytes of data from the open device.
-If
-.Ar count
-exceeds the size of the data buffer (10 kilobytes), it is
-truncated to the data buffer size.
-.Nm Rmt
-then performs the requested 
-.Xr read 2
-and responds with 
-.Sm off
-.Sy A Ar count-read No \en
-.Sm on
-if the read was
-successful; otherwise an error in the
-standard format is returned.  If the read
-was successful, the data read is then sent.
-.Sm off
-.It Xo Sy I Ar operation
-.No \en Ar count No \en
-.Xc
-.Sm on
-Perform a
-.Dv MTIOCOP
-.Xr ioctl 2
-command using the specified parameters.
-The parameters are interpreted as the
-.Tn ASCII
-representations of the decimal values
-to place in the 
-.Ar mt_op
-and
-.Ar mt_count
-fields of the structure used in the
-.Xr ioctl
-call.  The return value is the
-.Ar count
-parameter when the operation is successful.
-.ne 1i
-.It Sy S
-Return the status of the open device, as
-obtained with a
-.Dv MTIOCGET
-.Xr ioctl
-call.  If the operation was successful,
-an ``ack'' is sent with the size of the
-status buffer, then the status buffer is
-sent (in binary).
-.El
-.Sm on
-.Pp
-Any other command causes 
-.Nm
-to exit.
-.Sh DIAGNOSTICS
-All responses are of the form described above.
-.Sh SEE ALSO
-.Xr rcmd 3 ,
-.Xr rexec 3 ,
-.Xr mtio 4 ,
-.Xr rdump 8 ,
-.Xr rrestore 8
-.Sh BUGS
-People should be discouraged from using this for a remote
-file access protocol.
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Bx 4.2 .
diff --git a/rmt/rmt.8.in b/rmt/rmt.8.in
new file mode 100644 (file)
index 0000000..2f3b3df
--- /dev/null
@@ -0,0 +1,236 @@
+.\" Copyright (c) 1983, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)rmt.8      8.3 (Berkeley) 6/1/94
+.\"
+.Dd __DATE__
+.Dt RMT 8
+.Os "__VERSION__"
+.Sh NAME
+.Nm rmt
+.Nd remote magtape protocol module
+.Sh SYNOPSIS
+.Nm rmt
+.Sh DESCRIPTION
+.Nm Rmt
+is a program used by the remote dump and restore programs
+in manipulating a magnetic tape drive through an interprocess
+communication connection.
+.Nm Rmt
+is normally started up with an
+.Xr rexec 3
+or
+.Xr rcmd 3
+call.
+.Pp
+The 
+.Nm
+program accepts requests specific to the manipulation of
+magnetic tapes, performs the commands, then responds with
+a status indication.  All responses are in
+.Tn ASCII
+and in
+one of two forms. 
+Successful commands have responses of:
+.Bd -filled -offset indent
+.Sm off
+.Sy A Ar number No \en
+.Sm on
+.Ed
+.Pp
+.Ar Number
+is an
+.Tn ASCII
+representation of a decimal number.
+Unsuccessful commands are responded to with:
+.Bd -filled -offset indent
+.Sm off
+.Xo Sy E Ar error-number
+.No \en Ar error-message
+.No \en
+.Xc
+.Sm on
+.Ed
+.Pp
+.Ar Error-number
+is one of the possible error
+numbers described in
+.Xr intro 2
+and
+.Ar error-message
+is the corresponding error string as printed
+from a call to
+.Xr perror 3 .
+The protocol is comprised of the
+following commands, which are sent as indicated - no spaces are supplied
+between the command and its arguments, or between its arguments, and
+.Ql \en
+indicates that a newline should be supplied:
+.Bl -tag -width Ds
+.Sm off
+.It Xo Sy \&O Ar device
+.No \en Ar mode No \en
+.Xc
+Open the specified 
+.Ar device
+using the indicated
+.Ar mode .
+.Ar Device
+is a full pathname and
+.Ar mode
+is an
+.Tn ASCII
+representation of a decimal
+number suitable for passing to
+.Xr open 2 .
+If a device had already been opened, it is
+closed before a new open is performed.
+.It Xo Sy C Ar device No \en
+.Xc
+Close the currently open device.  The
+.Ar device
+specified is ignored.
+.It Xo Sy L
+.Ar whence No \en
+.Ar offset No \en
+.Xc
+.Sm on
+Perform an
+.Xr lseek 2
+operation using the specified parameters.
+The response value is that returned from the
+.Xr lseek
+call.
+.Sm off
+.It Sy W Ar count No \en
+.Sm on
+Write data onto the open device.
+.Nm Rmt
+reads
+.Ar count
+bytes from the connection, aborting if
+a premature end-of-file is encountered.
+The response value is that returned from
+the
+.Xr write 2
+call.
+.Sm off
+.It Sy R Ar count No \en
+.Sm on
+Read
+.Ar count
+bytes of data from the open device.
+If
+.Ar count
+exceeds the size of the data buffer (10 kilobytes), it is
+truncated to the data buffer size.
+.Nm Rmt
+then performs the requested 
+.Xr read 2
+and responds with 
+.Sm off
+.Sy A Ar count-read No \en
+.Sm on
+if the read was
+successful; otherwise an error in the
+standard format is returned.  If the read
+was successful, the data read is then sent.
+.Sm off
+.It Xo Sy I Ar operation
+.No \en Ar count No \en
+.Xc
+.Sm on
+Perform a
+.Dv MTIOCOP
+.Xr ioctl 2
+command using the specified parameters.
+The parameters are interpreted as the
+.Tn ASCII
+representations of the decimal values
+to place in the 
+.Ar mt_op
+and
+.Ar mt_count
+fields of the structure used in the
+.Xr ioctl
+call.  The return value is the
+.Ar count
+parameter when the operation is successful.
+.ne 1i
+.It Sy S
+Return the status of the open device, as
+obtained with a
+.Dv MTIOCGET
+.Xr ioctl
+call.  If the operation was successful,
+an ``ack'' is sent with the size of the
+status buffer, then the status buffer is
+sent (in binary).
+.El
+.Sm on
+.Pp
+Any other command causes 
+.Nm
+to exit.
+.Sh DIAGNOSTICS
+All responses are of the form described above.
+.Sh SEE ALSO
+.Xr rcmd 3 ,
+.Xr rexec 3 ,
+.Xr mtio 4 ,
+.Xr rdump 8 ,
+.Xr rrestore 8
+.Sh BUGS
+People should be discouraged from using this for a remote
+file access protocol.
+.Sh AUTHOR
+The
+.Nm dump/restore
+backup suit was ported to Linux's Second Extended File System
+by Remy Card <card@Linux.EU.Org>. He maintained the initial versions
+of dump (up and including 0.4b4, released in january 1997).
+.Pp
+Starting with 0.4b5, the new maintainer is Stelian Pop
+.br
+<pop@cybercable.fr>.
+.Sh AVAILABILITY
+The
+.Nm dump/restore
+backup suit is available for anonymous ftp from tsx-11.mit.edu
+in /pub/linux/ALPHA/ext2fs (development versions) or
+/pub/linux/packages/ext2fs (stable versions).
+.Pp
+An alternate downloading location is http://perso.cybercable.fr/pop/dump.
+.Sh HISTORY
+The
+.Nm
+command appeared in
+.Bx 4.2 .
index 92353af4d2ee77ef3297ffd391ac683ed5b2a45f..7e79dfb2caaf2f9bd5700bf3a8bde91341472473 100644 (file)
--- a/rmt/rmt.c
+++ b/rmt/rmt.c
@@ -50,7 +50,7 @@ static const char copyright[] =
 static char sccsid[] = "@(#)rmt.c      8.1 (Berkeley) 6/6/93";
 #endif
 static const char rcsid[] =
 static char sccsid[] = "@(#)rmt.c      8.1 (Berkeley) 6/6/93";
 #endif
 static const char rcsid[] =
-       "$Id: rmt.c,v 1.3 1999/10/11 12:59:21 stelian Exp $";
+       "$Id: rmt.c,v 1.4 1999/10/11 13:08:11 stelian Exp $";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -80,7 +80,7 @@ int   maxrecsize = -1;
 
 #define        SSIZE   64
 char   device[SSIZE];
 
 #define        SSIZE   64
 char   device[SSIZE];
-char   count[SSIZE], mode[SSIZE], pos[SSIZE], op[SSIZE];
+char   count[SSIZE], filemode[SSIZE], pos[SSIZE], op[SSIZE];
 
 char   resp[BUFSIZ];
 
 
 char   resp[BUFSIZ];
 
@@ -118,14 +118,14 @@ top:
                if (tape >= 0)
                        (void) close(tape);
                getstring(device);
                if (tape >= 0)
                        (void) close(tape);
                getstring(device);
-               getstring(mode);
-               DEBUG2("rmtd: O %s %s\n", device, mode);
+               getstring(filemode);
+               DEBUG2("rmtd: O %s %s\n", device, filemode);
                /*
                 * XXX the rmt protocol does not provide a means to
                 * specify the permission bits; allow rw for everyone,
                 * as modified by the users umask
                 */
                /*
                 * XXX the rmt protocol does not provide a means to
                 * specify the permission bits; allow rw for everyone,
                 * as modified by the users umask
                 */
-               tape = open(device, atoi(mode), 0666);
+               tape = open(device, atoi(filemode), 0666);
                if (tape < 0)
                        goto ioerror;
                goto respond;
                if (tape < 0)
                        goto ioerror;
                goto respond;