From 8d4197bb9ba5bbcef21409231ed8903b0cac353a Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Mon, 11 Oct 1999 13:08:02 +0000 Subject: [PATCH] Version 0.4b7. --- CHANGES | 70 ++++++- MCONFIG.in | 4 + Makefile.in | 2 +- THANKS | 6 +- TODO | 22 +++ common/dumprmt.c | 2 +- compat/include/Makefile.in | 24 +++ compat/include/bsdcompat.h | 16 +- compat/include/compaterr.h | 2 +- .../include/{pathnames.h => pathnames.h.in} | 2 +- compat/lib/compaterr.c | 2 +- configure | 90 +++++---- configure.in | 30 ++- debian-patch | 178 ------------------ dump-0.2.announce | 41 ---- dump-0.2a.announce | 27 --- dump-0.2b.announce | 28 --- dump-0.2c.announce | 12 -- dump-0.2d.announce | 12 -- dump-0.2e.announce | 19 -- dump-0.3.announce | 32 ---- dump-0.4b1.announce | 35 ---- dump.lsm | 10 +- dump/Makefile.in | 11 +- dump/{dump.8 => dump.8.in} | 46 +++-- dump/dump.h | 6 +- dump/itime.c | 51 ++--- dump/main.c | 22 ++- dump/optr.c | 83 ++++---- dump/tape.c | 44 +++-- dump/traverse.c | 4 +- dump/unctime.c | 2 +- restore/Makefile.in | 10 +- restore/dirs.c | 7 +- restore/extern.h | 6 +- restore/interactive.c | 27 ++- restore/main.c | 17 +- restore/{restore.8 => restore.8.in} | 41 ++-- restore/restore.c | 2 +- restore/symtab.c | 2 +- restore/tape.c | 20 +- restore/utilities.c | 3 +- rmt/Makefile.in | 10 +- rmt/{rmt.8 => rmt.8.in} | 22 ++- rmt/rmt.c | 10 +- 45 files changed, 471 insertions(+), 641 deletions(-) create mode 100644 compat/include/Makefile.in rename compat/include/{pathnames.h => pathnames.h.in} (98%) delete mode 100644 debian-patch delete mode 100644 dump-0.2.announce delete mode 100644 dump-0.2a.announce delete mode 100644 dump-0.2b.announce delete mode 100644 dump-0.2c.announce delete mode 100644 dump-0.2d.announce delete mode 100644 dump-0.2e.announce delete mode 100644 dump-0.3.announce delete mode 100644 dump-0.4b1.announce rename dump/{dump.8 => dump.8.in} (92%) rename restore/{restore.8 => restore.8.in} (95%) rename rmt/{rmt.8 => rmt.8.in} (89%) diff --git a/CHANGES b/CHANGES index 7e9b617..5695986 100644 --- 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 ). + +4. Made possible to dump a file system not mentioned in /etc/fstab. + (Debian bug #11904, patch provided by Eirik Fuller ). + +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: @@ -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. -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). -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 ). + +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 @@ -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. -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 diff --git a/MCONFIG.in b/MCONFIG.in index 7bb0410..4c73eda 100644 --- a/MCONFIG.in +++ b/MCONFIG.in @@ -2,6 +2,9 @@ VPATH= $(srcdir) top_builddir= @top_builddir@ +VERSION= dump 0.4b7 +DATE= October 8, 1999 + AR= @AR@ CC= @CC@ INSTALL= @INSTALL@ @@ -24,6 +27,7 @@ INSTALLMAN= $(INSTALL) -o $(MANOWNER) -g $(MANGRP) -m $(MANMODE) BINDIR= /sbin MANDIR= /usr/man/man8 +DUMPDATESPATH= @DUMPDATESPATH@ # # Global include directories # diff --git a/Makefile.in b/Makefile.in index 68e861e..34152c7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ top_srcdir= @top_srcdir@ @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 \ diff --git a/THANKS b/THANKS index 427f2cf..092b0c5 100644 --- a/THANKS +++ b/THANKS @@ -9,7 +9,8 @@ Kevin Layer added the comparison code in restore. Doug Paul helped me to make dump able to backup 2GB+ filesystems. -David Frey (the Debian dump maintainer) and the people +David Frey (the old Debian dump maintainer), +Bdale Garbee (the new Debian dump maintainer) and the people from Red Hat Software provided lots of patches. Stelian Pop 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): -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 diff --git a/TODO b/TODO index 33b773f..1fdb8e3 100644 --- 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. + +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). diff --git a/common/dumprmt.c b/common/dumprmt.c index b7cf041..6a79d07 100644 --- a/common/dumprmt.c +++ b/common/dumprmt.c @@ -44,7 +44,7 @@ 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__ diff --git a/compat/include/Makefile.in b/compat/include/Makefile.in new file mode 100644 index 0000000..9c2e02b --- /dev/null +++ b/compat/include/Makefile.in @@ -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 +# + diff --git a/compat/include/bsdcompat.h b/compat/include/bsdcompat.h index 421e4cf..7a3b11e 100644 --- a/compat/include/bsdcompat.h +++ b/compat/include/bsdcompat.h @@ -8,6 +8,7 @@ #include #include +#include #define __dead volatile @@ -107,7 +108,9 @@ struct dinode { * This is the 4.4BSD directory entry structure */ #define DIRBLKSIZ DEV_BSIZE +#ifndef MAXNAMLEN #define MAXNAMLEN 255 +#endif struct direct { __u32 d_ino; @@ -121,19 +124,6 @@ struct direct { 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. */ diff --git a/compat/include/compaterr.h b/compat/include/compaterr.h index a45bb98..3aed6ba 100644 --- a/compat/include/compaterr.h +++ b/compat/include/compaterr.h @@ -39,7 +39,7 @@ * 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_ diff --git a/compat/include/pathnames.h b/compat/include/pathnames.h.in similarity index 98% rename from compat/include/pathnames.h rename to compat/include/pathnames.h.in index 3e4194a..1679565 100644 --- a/compat/include/pathnames.h +++ b/compat/include/pathnames.h.in @@ -45,6 +45,6 @@ #define _PATH_DEFTAPE "/dev/st0" #define _PATH_DTMP "/etc/dtmp" -#define _PATH_DUMPDATES "/etc/dumpdates" +#define _PATH_DUMPDATES "__DUMPDATES__" #define _PATH_LOCK "/tmp/dumplockXXXXXX" #define _PATH_RMT "/etc/rmt" /* path on remote host */ diff --git a/compat/lib/compaterr.c b/compat/lib/compaterr.c index a77f1ba..d882068 100644 --- a/compat/lib/compaterr.c +++ b/compat/lib/compaterr.c @@ -42,7 +42,7 @@ #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 diff --git a/configure b/configure index 754af59..096ebde 100755 --- a/configure +++ b/configure @@ -11,8 +11,6 @@ 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 @@ -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" +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 @@ -1269,21 +1269,6 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' 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" @@ -1459,8 +1444,20 @@ echo "MANMODE defaults to $MANMODE" 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 "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= @@ -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 < 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 : @@ -1492,13 +1489,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < 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 : @@ -1509,13 +1506,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < 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 : @@ -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 -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 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* @@ -1574,7 +1571,7 @@ ext2fs_h=no 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 @@ -1582,7 +1579,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lext2fs -lcom_err $LIBS" cat > conftest.$ac_ext <&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 @@ -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 -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 <&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 @@ -1675,12 +1672,12 @@ done 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 < #include @@ -1688,7 +1685,7 @@ else #include 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* @@ -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 @@ -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 @@ -1744,7 +1741,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #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 -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 @@ -1779,12 +1776,12 @@ EOF 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 < #if STDC_HEADERS @@ -1812,12 +1809,12 @@ EOF 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 < #if STDC_HEADERS @@ -1952,7 +1949,7 @@ done 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 <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/configure.in b/configure.in index b6037a0..a66f628 100644 --- a/configure.in +++ b/configure.in @@ -19,22 +19,6 @@ AC_CHECK_TOOL(PATCH, patch, :) 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 @@ -207,6 +191,18 @@ echo "MANMODE defaults to $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 @@ -242,4 +238,4 @@ test -d compat/lib || mkdir compat/lib 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 index b0349f2..0000000 --- a/debian-patch +++ /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 , 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 , 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 , 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 index 9ddec37..0000000 --- a/dump-0.2.announce +++ /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 index 130ac8a..0000000 --- a/dump-0.2a.announce +++ /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 , Bob Snyder -, and Florian La Roche 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 index b378ec4..0000000 --- a/dump-0.2b.announce +++ /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 , Bob Snyder -, and Florian La Roche 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 index d0da6b7..0000000 --- a/dump-0.2c.announce +++ /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 index afc10d5..0000000 --- a/dump-0.2d.announce +++ /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 - 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 index cdf5c0b..0000000 --- a/dump-0.2e.announce +++ /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 - 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 index c5ebc2a..0000000 --- a/dump-0.3.announce +++ /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 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 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 - for sending me a patch much cleaner than mine :-) - - Kevin Layer 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 index 9054672..0000000 --- a/dump-0.4b1.announce +++ /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 - diff --git a/dump.lsm b/dump.lsm index b72e9ab..4c5c534 100644 --- a/dump.lsm +++ b/dump.lsm @@ -1,15 +1,15 @@ 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 - 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/* diff --git a/dump/Makefile.in b/dump/Makefile.in index a2e872a..2843a7b 100644 --- a/dump/Makefile.in +++ b/dump/Makefile.in @@ -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 -all:: $(PROG) +all:: $(PROG) dump.8 $(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); \ @@ -36,7 +41,7 @@ install:: $(PROG) 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 diff --git a/dump/dump.8 b/dump/dump.8.in similarity index 92% rename from dump/dump.8 rename to dump/dump.8.in index b7f427e..84e462c 100644 --- a/dump/dump.8 +++ b/dump/dump.8.in @@ -31,11 +31,11 @@ .\" SUCH DAMAGE. .\" .\" @(#)dump.8 8.3 (Berkeley) 5/1/95 -.\" $Id: dump.8,v 1.3 1999/10/11 12:59:18 stelian Exp $ +.\" $Id: dump.8.in,v 1.1 1999/10/11 13:08:07 stelian Exp $ .\" -.Dd June 4, 1997 +.Dd __DATE__ .Dt DUMP 8 -.Os BSD 4 +.Os "__VERSION__" .Sh NAME .Nm dump .Nd ext2 filesystem backup @@ -65,7 +65,7 @@ .Nm dump .Op Fl W Li \&| Fl w .Pp -.in -\\n(iSu +.in (The .Bx 4.3 option syntax is implemented for backward compatibility but @@ -222,7 +222,7 @@ The default tape length is 2300 feet. .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 . +.Pa __DUMPDATES__ . The format of .Ar date is the same as that of @@ -236,10 +236,10 @@ option is mutually exclusive from the option. .It Fl u Update the file -.Pa /etc/dumpdates +.Pa __DUMPDATES__ after a successful dump. The format of -.Pa /etc/dumpdates +.Pa __DUMPDATES__ is readable by people, consisting of one free format record per line: filesystem name, @@ -249,14 +249,14 @@ and format dump date. There may be only one entry per filesystem at each level. The file -.Pa /etc/dumpdates +.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 /etc/dumpdates +.Pa __DUMPDATES__ and .Pa /etc/fstab . The @@ -264,7 +264,7 @@ The option causes .Nm to print out, for each file system in -.Pa /etc/dumpdates , +.Pa __DUMPDATES__ , the most recent dump date and level, and highlights those file systems that should be dumped. If the @@ -337,7 +337,7 @@ to minimize the number of tapes follows: .It Always start with a level 0 backup, for example: .Bd -literal -offset indent -/sbin/dump -0u -f /dev/nrst1 /usr/src +/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, @@ -382,10 +382,10 @@ will be used to determine the pathname of the remote .Xr rmt 8 program. .Sh FILES -.Bl -tag -width /etc/dumpdates -compact +.Bl -tag -width __DUMPDATES__ -compact .It Pa /dev/st0 default tape unit to dump to -.It Pa /etc/dumpdates +.It Pa __DUMPDATES__ dump date records .It Pa /etc/fstab dump table: file systems and frequency @@ -423,7 +423,7 @@ or .Fl w option does not report filesystems that have never been recorded in -.Pa /etc/dumpdates , +.Pa __DUMPDATES__ , even if listed in .Pa /etc/fstab . .Pp @@ -442,6 +442,24 @@ 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 . 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 +. +.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 diff --git a/dump/dump.h b/dump/dump.h index 8424c71..ba7ed38 100644 --- a/dump/dump.h +++ b/dump/dump.h @@ -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 */ -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]) @@ -229,7 +229,7 @@ extern int errno; #endif #ifdef __linux__ -#define DUMP_CURRENT_REV 0 +#define DUMP_CURRENT_REV 1 #endif #ifndef __linux__ diff --git a/dump/itime.c b/dump/itime.c index a1b66f9..e29632c 100644 --- a/dump/itime.c +++ b/dump/itime.c @@ -44,7 +44,7 @@ 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 @@ -93,7 +93,7 @@ static int makedumpdate __P((struct dumpdates *, char *)); static void readdumptimes __P((FILE *)); void -initdumptimes(void) +initdumptimes(int createdumpdates) { FILE *df; @@ -103,25 +103,31 @@ initdumptimes(void) 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); - 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 @@ -152,7 +158,7 @@ readdumptimes(FILE *df) } void -getdumptime(void) +getdumptime(int createdumpdates) { 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 (uflag == 0) + if (!uflag && level == lastlevel) + return; + initdumptimes(createdumpdates); + if (ddatev == NULL) return; - - initdumptimes(); /* * Go find the entry with the same name for a lower increment * and older date diff --git a/dump/main.c b/dump/main.c index ca30a9c..58ff5c3 100644 --- a/dump/main.c +++ b/dump/main.c @@ -50,7 +50,7 @@ static const char copyright[] = 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 @@ -343,7 +343,6 @@ main(int argc, char *argv[]) signal(SIGTERM, sig); if (signal(SIGINT, interrupt) == SIG_IGN) signal(SIGINT, SIG_IGN); - 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) - 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, -#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)); @@ -550,7 +556,11 @@ main(int argc, char *argv[]) "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)); +#endif 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); } +#ifdef __linux__ + (void)time4(&(tend_writing)); +#else (void)time((time_t *)&(tend_writing)); +#endif spcl.c_type = TS_END; for (i = 0; i < ntrec; i++) writeheader(maxino - 1); diff --git a/dump/optr.c b/dump/optr.c index 96b829a..ab38a3d 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -44,7 +44,7 @@ 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 @@ -60,6 +60,7 @@ static const char rcsid[] = #include #include #include +#include #ifdef __linux__ #include @@ -97,7 +98,11 @@ query(const char *question) 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)); @@ -130,12 +135,16 @@ query(const char *question) 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. */ - if (tstart_writing != 0) + if ((tstart_writing != 0) && (when_answered != (time_t)-1) && (firstprompt != (time_t)-1)) tstart_writing += (when_answered - firstprompt); return(back); } @@ -314,7 +323,11 @@ timeest(void) { time_t tnow, deltat; +#ifdef __linux__ + (void) time4(&tnow); +#else (void) time((time_t *) &tnow); +#endif 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; + 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; @@ -534,40 +551,42 @@ lastdump(char arg) /* w ==> just what to do; W ==> most recent dumps */ { 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 - (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); + } } } diff --git a/dump/tape.c b/dump/tape.c index b48665e..741f2de 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -44,7 +44,7 @@ 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__ @@ -270,10 +270,19 @@ do_stats(void) time_t tnow, ttaken; int blocks; +#ifdef __linux__ + (void)time4(&tnow); +#else (void)time(&tnow); +#endif 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); @@ -299,7 +308,11 @@ statussig(int notused) if (blockswritten < 500) return; +#ifdef __linux__ + (void) time4(&tnow); +#else (void) time((time_t *) &tnow); +#endif 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) { - time_t tstart_changevol, tend_changevol; - 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"); @@ -465,13 +471,6 @@ close_rewind(void) 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 @@ -637,7 +636,11 @@ startnewtape(int top) 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); @@ -750,7 +753,12 @@ restore_check_point: 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); diff --git a/dump/traverse.c b/dump/traverse.c index 59ce524..d408993 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -44,7 +44,7 @@ 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 @@ -338,7 +338,7 @@ mapdirs(ino_t maxino, long *tapesize) register int isdir; register char *map; register ino_t ino; -#ifndef __linux +#ifndef __linux__ register int i; long filesize; #endif diff --git a/dump/unctime.c b/dump/unctime.c index bd72453..ec0960f 100644 --- a/dump/unctime.c +++ b/dump/unctime.c @@ -44,7 +44,7 @@ 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 diff --git a/restore/Makefile.in b/restore/Makefile.in index e032d18..d8257fd 100644 --- a/restore/Makefile.in +++ b/restore/Makefile.in @@ -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 -all:: $(PROG) +all:: $(PROG) restore.8 $(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); \ @@ -37,7 +41,7 @@ install:: $(PROG) 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 diff --git a/restore/dirs.c b/restore/dirs.c index 30cec66..a6611c6 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -49,7 +49,7 @@ 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 @@ -658,10 +658,11 @@ setdirmodes(int flags) cp = myname(ep); (void) chown(cp, node.uid, node.gid); (void) chmod(cp, node.mode); + if (node.flags) #ifdef __linux__ - (void) setflags(cp, node.flags); + (void) fsetflags(cp, node.flags); #else - (void) chflags(cp, node.flags); + (void) chflags(cp, node.flags); #endif utimes(cp, node.timep); ep->e_flags &= ~NEW; diff --git a/restore/extern.h b/restore/extern.h index 8d8740b..46e6cc2 100644 --- a/restore/extern.h +++ b/restore/extern.h @@ -39,7 +39,7 @@ * 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)); @@ -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)); + +/* From e2fsprogs */ +int fsetflags __P((const char *, unsigned long)); +int setflags __P((int, unsigned long)); diff --git a/restore/interactive.c b/restore/interactive.c index de958bb..2f26278 100644 --- a/restore/interactive.c +++ b/restore/interactive.c @@ -44,7 +44,7 @@ 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 @@ -561,12 +561,12 @@ printlist(char *name, char *basename) 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, - (int)dp->d_namlen); + (int)strlen(dp->d_name)); mkentry(locname, dp, listp++); entries++; } @@ -633,9 +633,12 @@ mkentry(char *name, struct direct *dp, struct afile *fp) fp->postfix = '#'; break; +#ifndef __linux__ + /* no need for this */ case DT_WHT: fp->postfix = '%'; break; +#endif 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. + * + * 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 #undef d_ino -#endif /* __linux__ */ +#endif /* ! __linux__ */ 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) @@ -747,7 +744,6 @@ glob_readdir(RST_DIR *dirp) 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); } @@ -759,7 +755,6 @@ static int 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)) diff --git a/restore/main.c b/restore/main.c index f979560..7460d7d 100644 --- a/restore/main.c +++ b/restore/main.c @@ -50,7 +50,7 @@ static const char copyright[] = 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 @@ -361,12 +361,17 @@ main(int argc, char *argv[]) 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", - "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); } diff --git a/restore/restore.8 b/restore/restore.8.in similarity index 95% rename from restore/restore.8 rename to restore/restore.8.in index 676e3c4..5c12337 100644 --- a/restore/restore.8 +++ b/restore/restore.8.in @@ -30,11 +30,11 @@ .\" SUCH DAMAGE. .\" .\" @(#)restore.8 8.4 (Berkeley) 5/1/95 -.\" $Id: restore.8,v 1.3 1999/10/11 12:59:20 stelian Exp $ +.\" $Id: restore.8.in,v 1.1 1999/10/11 13:08:09 stelian Exp $ .\" -.Dd May 1, 1995 +.Dd __DATE__ .Dt RESTORE 8 -.Os BSD 4 +.Os "__VERSION__" .Sh NAME .Nm restore .Nd "restore files or file systems from backups made with dump" @@ -85,7 +85,7 @@ .Op Fl T Ar directory .Op file ... .Pp -.in -\\n(iSu +.in (The .Bx 4.3 option syntax is implemented for backward compatibility but @@ -206,7 +206,7 @@ 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 , +.Xr mke2fs 8 , mounted, and the user .Xr cd Ns 'd into the pristine file system @@ -221,11 +221,11 @@ 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 +mke2fs /dev/sda1 +mount /dev/sda1 /mnt cd /mnt -restore rf /dev/rst8 +restore rf /dev/st0 .Ed .Pp Note that @@ -239,7 +239,7 @@ restored. .Pp .Nm Restore , in conjunction with -.Xr newfs 8 +.Xr mke2fs 8 and .Xr dump 8 , may be used to modify file system parameters @@ -312,7 +312,7 @@ may be a special device file like .Pa /dev/st0 (a tape drive), -.Pa /dev/rsd1c +.Pa /dev/sda1 (a disk drive), an ordinary file, or @@ -493,8 +493,7 @@ information passed between incremental restores .Sh SEE ALSO .Xr dump 8 , .Xr mount 8 , -.Xr newfs 8 , -.Xr mkfs 8 , +.Xr mke2fs 8 , .Xr rmt 8 .Sh BUGS .Nm Restore @@ -536,6 +535,24 @@ 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 . 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 +. +.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 diff --git a/restore/restore.c b/restore/restore.c index f1986a4..3eb6d93 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -44,7 +44,7 @@ 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 diff --git a/restore/symtab.c b/restore/symtab.c index 27343d9..275dd1c 100644 --- a/restore/symtab.c +++ b/restore/symtab.c @@ -44,7 +44,7 @@ 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 */ /* diff --git a/restore/tape.c b/restore/tape.c index 9e1e28c..ab0513a 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -49,7 +49,7 @@ 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 @@ -602,10 +602,11 @@ extractfile(char *name) } (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid); (void) chmod(name, mode); + if (flags) #ifdef __linux__ - (void) fsetflags(name, flags); + (void) fsetflags(name, flags); #else - (void) chflags(name, flags); + (void) chflags(name, flags); #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); + if (flags) #ifdef __linux__ - (void) fsetflags(name, flags); + { + warn("%s: fsetflags called on a special file", name); + (void) fsetflags(name, flags); + } #else - (void) chflags(name, flags); + (void) chflags(name, flags); #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); + if (flags) #ifdef __linux__ - (void) fsetflags(ofile, flags); + (void) setflags(ofile, flags); #else - (void) fchflags(ofile, flags); + (void) fchflags(ofile, flags); #endif getfile(xtrfile, xtrskip); (void) close(ofile); diff --git a/restore/utilities.c b/restore/utilities.c index 7c3bcd8..1498599 100644 --- a/restore/utilities.c +++ b/restore/utilities.c @@ -44,7 +44,7 @@ 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 @@ -157,7 +157,6 @@ void newnode(struct entry *np) { char *cp; - if (np->e_type != NODE) badentry(np, "newnode: not a node"); cp = myname(np); diff --git a/rmt/Makefile.in b/rmt/Makefile.in index 973d942..e1d4440 100644 --- a/rmt/Makefile.in +++ b/rmt/Makefile.in @@ -18,17 +18,21 @@ SRCS= rmt.c OBJS= rmt.o MAN8= rmt.8 -all:: $(PROG) +all:: $(PROG) rmt.8 $(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:: - rm -f $(PROG) \#* *.s *.o *.a *~ core + rm -f $(PROG) \#* *.s *.o *.a *~ core rmt.8 distclean:: clean rm -f Makefile Makefile.old .depend diff --git a/rmt/rmt.8 b/rmt/rmt.8.in similarity index 89% rename from rmt/rmt.8 rename to rmt/rmt.8.in index 8f9d0df..2f3b3df 100644 --- a/rmt/rmt.8 +++ b/rmt/rmt.8.in @@ -31,9 +31,9 @@ .\" .\" @(#)rmt.8 8.3 (Berkeley) 6/1/94 .\" -.Dd June 1, 1994 +.Dd __DATE__ .Dt RMT 8 -.Os BSD 4.2 +.Os "__VERSION__" .Sh NAME .Nm rmt .Nd remote magtape protocol module @@ -211,6 +211,24 @@ All responses are of the form described above. .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 . 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 +. +.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 diff --git a/rmt/rmt.c b/rmt/rmt.c index 92353af..7e79dfb 100644 --- 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[] = - "$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 */ /* @@ -80,7 +80,7 @@ int maxrecsize = -1; #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]; @@ -118,14 +118,14 @@ top: 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 */ - tape = open(device, atoi(mode), 0666); + tape = open(device, atoi(filemode), 0666); if (tape < 0) goto ioerror; goto respond; -- 2.39.5