diff -Nru dump-0.4b45/AUTHORS dump-0.4b46/AUTHORS --- dump-0.4b45/AUTHORS 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/AUTHORS 2016-09-05 19:18:25.000000000 +0000 @@ -9,7 +9,7 @@ Doug Paul helped me to make dump able to backup 2GB+ filesystems. -David Frey (the old Debian dump maintainer), +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. @@ -120,7 +120,7 @@ Dirk Traenapp dtraenapp@users.sourceforge.net Erik Troan ewt@redhat.com Philippe Troin phil@fifi.org -Theodore Y. Ts'o tytso@valinux.com +Theodore Y. Ts'o tytso@valinux.com Stephen Tweedie sct@dcs.ed.ac.uk Matus Uhlar uhlar@fantomas.sk Amith Varghese amithv@yahoo.com @@ -134,3 +134,5 @@ Ian Zimmerman itz@speakeasy.org Florian Zumbiehl florz@gmx.de Mike Frysinger vapier@gentoo.org +Alexander Zangerl az@debian.org +Josef Ridky jridky@redhat.com diff -Nru dump-0.4b45/common/dumprmt.c dump-0.4b46/common/dumprmt.c --- dump-0.4b45/common/dumprmt.c 2016-05-09 05:44:05.000000000 +0000 +++ dump-0.4b46/common/dumprmt.c 2016-06-08 05:01:45.000000000 +0000 @@ -292,9 +292,9 @@ char *rmtflags; rmtflags = rmtflags_tochar(mode); - (void)snprintf(buf, sizeof (buf), "O%s\n%d %s\n", - tape, - mode & O_ACCMODE, + (void)snprintf(buf, sizeof (buf), "O%s\n%d %s\n", + tape, + mode & O_ACCMODE, rmtflags); free(rmtflags); rmtstate = TS_OPEN; @@ -468,7 +468,7 @@ return -1; } if (pipe (from_child_pipe) < 0) { - msg ("cannot create pipe: %s\n", strerror(errno)); + msg ("cannot create pipe: %s\n", strerror(errno)); return -1; } pid = fork (); diff -Nru dump-0.4b45/common/indexer_test.c dump-0.4b46/common/indexer_test.c --- dump-0.4b45/common/indexer_test.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/common/indexer_test.c 2016-06-08 05:01:45.000000000 +0000 @@ -154,7 +154,7 @@ // indexer->addDirEntry(&direct, direct.d_ino); // dump_inode(indexer, &bufroot); //} - + while ((dp = readdir(dirp)) != NULL) { direct.d_ino = dp->d_ino; direct.d_reclen = dp->d_reclen; diff -Nru dump-0.4b45/common/legacy_indexer.c dump-0.4b46/common/legacy_indexer.c --- dump-0.4b45/common/legacy_indexer.c 2016-05-09 05:49:56.000000000 +0000 +++ dump-0.4b46/common/legacy_indexer.c 2016-09-05 18:37:56.000000000 +0000 @@ -38,7 +38,7 @@ extern dump_ino_t volinfo[]; // TP_NINOS extern int tapeno; -static int Afile = -1; /* archive file descriptor */ +extern int Afile; /* archive file descriptor */ static int AfileActive = 1;/* Afile flag */ //extern char *Apath; @@ -57,8 +57,8 @@ //extern int magtapeout; /* is output a magnetic tape? */ static int gtperr = 0; -static int gTapeposfd; -static char *gTapeposfile; +static int gTapeposfd = -1; /* code below assumes fd >= 0 means do print */ +const char *gTapeposfile; static char gTps[255]; static int32_t gThisDumpDate; #endif /* USE_QFA */ @@ -235,9 +235,11 @@ static int legacy_updateQfaState(QFA_State *s) { +#ifdef USE_QFA if (gTapeposfd >= 0) { s->cntntrecs += ntrec; } +#endif return 0; } @@ -260,7 +262,7 @@ for (i = 0; (i < ntrec) && !foundone; ++i) { uspclptr = (union u_spcl *)&slp->tblock[i]; spclptr = &uspclptr->s_spcl; - if ((spclptr->c_magic == NFS_MAGIC) && + if ((spclptr->c_magic == NFS_MAGIC) && (spclptr->c_type == TS_INODE) && (spclptr->c_date == gThisDumpDate) && !(spclptr->c_dinode.di_mode & S_IFDIR) && @@ -269,7 +271,7 @@ foundone = 1; /* if (s->cntntrecs >= s->maxntrecs) { only write every maxntrecs amount of data */ s->cntntrecs = 0; - if (gtperr == 0) + if (gtperr == 0) gtperr = GetTapePos(&s->curtapepos); /* if an error occured previously don't * try again */ @@ -301,7 +303,7 @@ *pos = (long long) rmtseek((off_t)0, (int)LSEEK_GET_TAPEPOS); err = *pos < 0; } - else + else #endif { if (magtapeout) { @@ -317,14 +319,14 @@ } if (err) { err = errno; - msg("[%ld] error: %d (getting tapepos: %lld)\n", getpid(), + msg("[%ld] error: %d (getting tapepos: %lld)\n", getpid(), err, *pos); return err; } return err; } -static int +static int MkTapeString(struct s_spcl *spclptr, long long curtapepos) { int err = 0; @@ -333,14 +335,14 @@ msg("inode %ld at tapepos %lld\n", spclptr->c_inumber, curtapepos); #endif - snprintf(gTps, sizeof(gTps), "%ld\t%d\t%lld\n", - (unsigned long)spclptr->c_inumber, - tapeno, + snprintf(gTps, sizeof(gTps), "%ld\t%d\t%lld\n", + (unsigned long)spclptr->c_inumber, + tapeno, curtapepos); gTps[sizeof(gTps) - 1] = '\0'; if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps)) { err = errno; - warn("error writing tapepos file. (error %d)\n", errno); + warn("error writing tapepos file. (error %d)\n", errno); } return err; } @@ -356,6 +358,7 @@ &legacy_addDirEntry, &legacy_openQfa, &legacy_closeQfa, + &legacy_openQfaState, &legacy_updateQfa, &legacy_updateQfaState }; diff -Nru dump-0.4b45/common/Makefile.am dump-0.4b46/common/Makefile.am --- dump-0.4b45/common/Makefile.am 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/common/Makefile.am 2016-06-08 05:01:45.000000000 +0000 @@ -19,7 +19,7 @@ $(ZLIB_LIBS) \ $(BZLIB) \ $(LZOLIB) \ - $(SSLLIB) \ + $(SSL_LIBS) \ $(SQLITE3) check_PROGRAMS = indexer_test diff -Nru dump-0.4b45/common/Makefile.in dump-0.4b46/common/Makefile.in --- dump-0.4b45/common/Makefile.in 2016-05-09 06:36:02.000000000 +0000 +++ dump-0.4b46/common/Makefile.in 2016-09-05 19:25:28.000000000 +0000 @@ -250,7 +250,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ -SSLLIB = @SSLLIB@ +SSL_CFLAGS = @SSL_CFLAGS@ +SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ @@ -329,7 +330,7 @@ $(ZLIB_LIBS) \ $(BZLIB) \ $(LZOLIB) \ - $(SSLLIB) \ + $(SSL_LIBS) \ $(SQLITE3) indexer_test_SOURCES = indexer_test.c diff -Nru dump-0.4b45/common/transformation.h dump-0.4b46/common/transformation.h --- dump-0.4b45/common/transformation.h 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/common/transformation.h 2016-09-05 18:39:23.000000000 +0000 @@ -121,18 +121,22 @@ extern Transformation transformation_null; #ifdef HAVE_LZO +#define HAVE_BLOCK_TRANSFORMATION 1 extern Transformation *transformation_lzo_factory(int enc); #endif /* HAVE_ZLIB */ #ifdef HAVE_ZLIB +#define HAVE_BLOCK_TRANSFORMATION 1 extern Transformation *transformation_zlib_factory(int enc, int complvl); #endif /* HAVE_ZLIB */ #ifdef HAVE_BZLIB +#define HAVE_BLOCK_TRANSFORMATION 1 extern Transformation *transformation_bzlib_factory(int enc, int complvl); #endif /* HAVE_BZLIB */ #ifdef HAVE_OPENSSL +#define HAVE_BLOCK_TRANSFORMATION 1 extern Transformation *transformation_ssl_factory(int enc, int complvl, const char *ciphername, const char *digestname); #endif /* HAVE_OPENSSL */ diff -Nru dump-0.4b45/common/transformation_ssl.c dump-0.4b46/common/transformation_ssl.c --- dump-0.4b45/common/transformation_ssl.c 2016-05-09 06:34:11.000000000 +0000 +++ dump-0.4b46/common/transformation_ssl.c 2016-06-08 05:01:45.000000000 +0000 @@ -44,7 +44,7 @@ * The greatest vulnerability is predictable keys (and weak ciphers * required by local laws). The key should also be protected in memory * while dumping and restoring files but it's not as critical since - * anyone able to read the key probably has the ability to read the + * anyone able to read the key probably has the ability to read the * filesystem directly. */ @@ -144,7 +144,7 @@ return 0; } - + /* * Start slave process. We need to reinitialize the encryption * engine. diff -Nru dump-0.4b45/compat/include/bylabel.h dump-0.4b46/compat/include/bylabel.h --- dump-0.4b45/compat/include/bylabel.h 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/compat/include/bylabel.h 2016-06-08 05:01:45.000000000 +0000 @@ -28,7 +28,7 @@ static inline const char * get_device_label(const char * spec) { return blkid_get_tag_value(NULL, "LABEL", spec); } - + #else const char * get_device_name(const char * item); diff -Nru dump-0.4b45/compat/include/compatglob.h dump-0.4b46/compat/include/compatglob.h --- dump-0.4b45/compat/include/compatglob.h 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/compat/include/compatglob.h 2016-06-08 05:01:45.000000000 +0000 @@ -65,7 +65,7 @@ * and lstat(2). */ void (*gl_closedir) (void *); - struct dirent *(*gl_readdir) (void *); + struct dirent *(*gl_readdir) (void *); void *(*gl_opendir) (const char *); int (*gl_lstat) (const char *, struct stat *); int (*gl_stat) (const char *, struct stat *); diff -Nru dump-0.4b45/compat/lib/bylabel.c dump-0.4b46/compat/lib/bylabel.c --- dump-0.4b45/compat/lib/bylabel.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/compat/lib/bylabel.c 2016-06-08 05:01:45.000000000 +0000 @@ -224,13 +224,13 @@ return get_spec_by_x(VOL, s); } -const char * +const char * get_device_name(const char * item) { const char * rc; if (!strncmp(item, "UUID=", 5)) { rc = get_spec_by_uuid(item+5); - } + } else if (!strncmp(item, "LABEL=", 6)) { rc = get_spec_by_volume_label(item+6); diff -Nru dump-0.4b45/compat/lib/compatglob.c dump-0.4b46/compat/lib/compatglob.c --- dump-0.4b45/compat/lib/compatglob.c 2016-05-09 05:44:06.000000000 +0000 +++ dump-0.4b46/compat/lib/compatglob.c 2016-06-08 05:01:45.000000000 +0000 @@ -337,8 +337,8 @@ if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) return pattern; - /* - * Copy up to the end of the string or / + /* + * Copy up to the end of the string or / */ eb = &patbuf[patbuf_len - 1]; for (p = pattern + 1, h = (char *) patbuf; @@ -405,7 +405,7 @@ int c, err, oldpathc; Char *bufnext, patbuf[MAXPATHLEN+1]; - qpatnext = globtilde(pattern, patbuf, sizeof(patbuf) / sizeof(Char), + qpatnext = globtilde(pattern, patbuf, sizeof(patbuf) / sizeof(Char), pglob); oldpathc = pglob->gl_pathc; bufnext = patbuf; diff -Nru dump-0.4b45/compat/lib/Makefile.in dump-0.4b46/compat/lib/Makefile.in --- dump-0.4b45/compat/lib/Makefile.in 2016-05-09 06:36:02.000000000 +0000 +++ dump-0.4b46/compat/lib/Makefile.in 2016-09-05 19:25:28.000000000 +0000 @@ -241,7 +241,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ -SSLLIB = @SSLLIB@ +SSL_CFLAGS = @SSL_CFLAGS@ +SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ diff -Nru dump-0.4b45/compat/lib/rmtflags.c dump-0.4b46/compat/lib/rmtflags.c --- dump-0.4b45/compat/lib/rmtflags.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/compat/lib/rmtflags.c 2016-06-08 05:01:45.000000000 +0000 @@ -157,13 +157,13 @@ char *result = (char *) malloc(4096); /* enough space */ switch (filemode & O_ACCMODE) { - case O_RDONLY: - strcpy(result, "O_RDONLY"); + case O_RDONLY: + strcpy(result, "O_RDONLY"); break; - case O_WRONLY: + case O_WRONLY: strcpy(result, "O_WRONLY"); break; - case O_RDWR: + case O_RDWR: strcpy(result, "O_RDWR"); break; default: diff -Nru dump-0.4b45/config.h.in dump-0.4b46/config.h.in --- dump-0.4b45/config.h.in 2016-05-09 06:36:02.000000000 +0000 +++ dump-0.4b46/config.h.in 2016-09-05 19:25:32.000000000 +0000 @@ -55,7 +55,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define this if you have openssl library. */ +/* Include OpenSSL support */ #undef HAVE_OPENSSL /* Define if you want to include readline support. */ diff -Nru dump-0.4b45/configure dump-0.4b46/configure --- dump-0.4b45/configure 2016-05-09 06:36:01.000000000 +0000 +++ dump-0.4b46/configure 2016-09-05 19:25:28.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for dump 0.4b45. +# Generated by GNU Autoconf 2.69 for dump 0.4b46. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='dump' PACKAGE_TARNAME='dump' -PACKAGE_VERSION='0.4b45' -PACKAGE_STRING='dump 0.4b45' +PACKAGE_VERSION='0.4b46' +PACKAGE_STRING='dump 0.4b46' PACKAGE_BUGREPORT='http://dump.sourceforge.net' PACKAGE_URL='' @@ -635,7 +635,8 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -SSLLIB +SSL_LIBS +SSL_CFLAGS SQLITE3 LZOLIB BZLIB @@ -833,7 +834,9 @@ UUID_CFLAGS UUID_LIBS ZLIB_CFLAGS -ZLIB_LIBS' +ZLIB_LIBS +SSL_CFLAGS +SSL_LIBS' # Initialize some variables set by options. @@ -1374,7 +1377,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dump 0.4b45 to adapt to many kinds of systems. +\`configure' configures dump 0.4b46 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1444,7 +1447,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dump 0.4b45:";; + short | recursive ) echo "Configuration of dump 0.4b46:";; esac cat <<\_ACEOF @@ -1536,6 +1539,8 @@ UUID_LIBS linker flags for UUID, overriding pkg-config ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config ZLIB_LIBS linker flags for ZLIB, overriding pkg-config + SSL_CFLAGS C compiler flags for SSL, overriding pkg-config + SSL_LIBS linker flags for SSL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1603,7 +1608,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dump configure 0.4b45 +dump configure 0.4b46 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2131,7 +2136,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dump $as_me 0.4b45, which was +It was created by dump $as_me 0.4b46, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2995,7 +3000,7 @@ # Define the identity of the package. PACKAGE='dump' - VERSION='0.4b45' + VERSION='0.4b46' cat >>confdefs.h <<_ACEOF @@ -14169,72 +14174,98 @@ enableval=$enable_ssl; fi -SSLLIB= if test "$enable_ssl" != "no"; then - ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_evp_h" = xyes; then : - evp_h=yes -else - evp_h=no -fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL" >&5 +$as_echo_n "checking for SSL... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_set_padding in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_set_padding in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding+:} false; then : - $as_echo_n "(cached) " >&6 +if test -n "$SSL_CFLAGS"; then + pkg_cv_SSL_CFLAGS="$SSL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SSL_CFLAGS=`$PKG_CONFIG --cflags "openssl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char EVP_CIPHER_CTX_set_padding (); -int -main () -{ -return EVP_CIPHER_CTX_set_padding (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=yes + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SSL_LIBS"; then + pkg_cv_SSL_LIBS="$SSL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SSL_LIBS=`$PKG_CONFIG --libs "openssl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=no + pkg_failed=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + else + pkg_failed=untried fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" = xyes; then : - crypto_lib=yes + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - crypto_lib=no + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + SSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl" 2>&1` + else + SSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SSL_PKG_ERRORS" >&5 + + + found_ssl="no" + if test "$enable_ssl" = "yes"; then + as_fn_error $? "OpenSSL support requested, but not found" "$LINENO" 5 + fi + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } - if test "$evp_h" = yes -a "$crypto_lib" = yes; then - SSLLIB="-lssl" + found_ssl="no" + if test "$enable_ssl" = "yes"; then + as_fn_error $? "OpenSSL support requested, but not found" "$LINENO" 5 + fi + +else + SSL_CFLAGS=$pkg_cv_SSL_CFLAGS + SSL_LIBS=$pkg_cv_SSL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + if test "$found_ssl" != "no"; then $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h - elif test "$enable_ssl" = "yes"; then - as_fn_error $? "ssl support requested, but not found" "$LINENO" 5 fi fi -if test "$ERMT" != "" -a -z "$SSLLIB"; then +if test "$ERMT" != "" -a -z "$SSL_LIBS"; then as_fn_error $? "You need to install the OpenSSL library (version 0.9.7a or later), or configure without --enable-ermt" "$LINENO" 5 fi - ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" case $ac_cv_c_int64_t in #( no|yes) ;; #( @@ -14261,7 +14292,7 @@ esac -ac_config_files="$ac_config_files Makefile common/Makefile compat/lib/Makefile dump/Makefile restore/Makefile rmt/Makefile" +ac_config_files="$ac_config_files dump.lsm Makefile common/Makefile compat/lib/Makefile dump/Makefile restore/Makefile rmt/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -14801,7 +14832,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dump $as_me 0.4b45, which was +This file was extended by dump $as_me 0.4b46, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14867,7 +14898,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dump config.status 0.4b45 +dump config.status 0.4b46 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -15282,6 +15313,7 @@ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "dump.lsm") CONFIG_FILES="$CONFIG_FILES dump.lsm" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "compat/lib/Makefile") CONFIG_FILES="$CONFIG_FILES compat/lib/Makefile" ;; diff -Nru dump-0.4b45/configure.ac dump-0.4b46/configure.ac --- dump-0.4b45/configure.ac 2016-05-09 06:35:33.000000000 +0000 +++ dump-0.4b46/configure.ac 2016-09-05 19:25:05.000000000 +0000 @@ -1,4 +1,4 @@ -AC_INIT([dump], [0.4b45], [http://dump.sourceforge.net]) +AC_INIT([dump], [0.4b46], [http://dump.sourceforge.net]) AC_PREREQ(2.57) AM_INIT_AUTOMAKE AM_SILENT_RULES([yes]) @@ -248,7 +248,7 @@ #include #endif #include ], -[ext2_ino_t ino = 0;], +[ext2_ino_t ino = 0;], [AC_DEFINE([HAVE_EXT2_INO_T],1,[Define if we have the ext2_ino_t type (from e2fsprogs 1.20+).]) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) @@ -429,13 +429,13 @@ dnl AC_MSG_CHECKING(for extended glob routines) if test "$ac_cv_func_glob" = "yes"; then - AC_EGREP_CPP(yes, + AC_EGREP_CPP(yes, [ # include # ifdef GLOB_ALTDIRFUNC yes # endif - ], + ], [ AC_DEFINE([HAVE_GLOB],1,[Define if you have the glob function.]) AC_MSG_RESULT(yes) @@ -450,21 +450,20 @@ dnl Check for OpenSSL, for ermt and encryption. dnl AC_ARG_ENABLE([ssl], [AC_HELP_STRING([--disable-ssl], [disable ssl support])]) -SSLLIB= if test "$enable_ssl" != "no"; then - AC_CHECK_HEADER(openssl/evp.h, [evp_h=yes], [evp_h=no]) - AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_set_padding, [crypto_lib=yes], [crypto_lib=no]) - if test "$evp_h" = yes -a "$crypto_lib" = yes; then - SSLLIB="-lssl" - AC_DEFINE([HAVE_OPENSSL],1,[Define this if you have openssl library.]) - elif test "$enable_ssl" = "yes"; then - AC_MSG_ERROR([ssl support requested, but not found]) + PKG_CHECK_MODULES([SSL], [openssl], [], [ + found_ssl="no" + if test "$enable_ssl" = "yes"; then + AC_MSG_ERROR([OpenSSL support requested, but not found]) + fi + ]) + if test "$found_ssl" != "no"; then + AC_DEFINE([HAVE_OPENSSL], 1, [Include OpenSSL support]) fi fi -if test "$ERMT" != "" -a -z "$SSLLIB"; then +if test "$ERMT" != "" -a -z "$SSL_LIBS"; then AC_MSG_ERROR([You need to install the OpenSSL library (version 0.9.7a or later), or configure without --enable-ermt]) fi -AC_SUBST(SSLLIB) dnl dnl Check for types @@ -476,6 +475,7 @@ dnl Output files dnl AC_CONFIG_FILES(m4_flatten([ + dump.lsm Makefile common/Makefile compat/lib/Makefile diff -Nru dump-0.4b45/debian/changelog dump-0.4b46/debian/changelog --- dump-0.4b45/debian/changelog 2016-09-17 11:59:43.000000000 +0000 +++ dump-0.4b46/debian/changelog 2016-10-20 09:26:43.000000000 +0000 @@ -1,8 +1,30 @@ -dump (0.4b45-4build1) yakkety; urgency=medium +dump (0.4b46-3) unstable; urgency=medium - * No-change rebuild for readline soname change. + * updated build rules to ensure a suitable + automake version is used (closes: #841131) - -- Matthias Klose Sat, 17 Sep 2016 11:59:43 +0000 + -- Alexander Zangerl Thu, 20 Oct 2016 19:24:44 +1000 + +dump (0.4b46-2) unstable; urgency=medium + + * updated symlink timestamp restoration patch, + reworked some of the other local patches + + -- Alexander Zangerl Sun, 09 Oct 2016 19:45:06 +1000 + +dump (0.4b46-1) unstable; urgency=medium + + * new upstream version, lifted standards version + + -- Alexander Zangerl Sun, 25 Sep 2016 13:44:27 +1000 + +dump (0.4b45-5) unstable; urgency=medium + + * amend build depends for lzo2 compression (closes: #836692) + * ensure that conditional compilation for compression-related + code is primed suitably (closes: #836548, #836674) + + -- Alexander Zangerl Mon, 05 Sep 2016 18:06:43 +1000 dump (0.4b45-4) unstable; urgency=medium diff -Nru dump-0.4b45/debian/control dump-0.4b46/debian/control --- dump-0.4b45/debian/control 2016-06-25 15:01:01.000000000 +0000 +++ dump-0.4b46/debian/control 2016-10-20 09:26:52.000000000 +0000 @@ -5,17 +5,19 @@ Build-Depends: debhelper (>= 9), autoconf, autotools-dev, + dh-autoreconf, comerr-dev, e2fslibs-dev, libblkid-dev, libbz2-dev, + liblzo2-dev, libdevmapper-dev, libreadline-dev, libselinux1-dev, pkg-config, uuid-dev, zlib1g-dev -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: http://dump.sourceforge.net Vcs-Git: git://anonscm.debian.org/collab-maint/dump.git Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/dump.git diff -Nru dump-0.4b45/debian/patches/archive_functionality dump-0.4b46/debian/patches/archive_functionality --- dump-0.4b45/debian/patches/archive_functionality 2016-08-21 04:17:59.000000000 +0000 +++ dump-0.4b46/debian/patches/archive_functionality 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ ---- a/common/legacy_indexer.c -+++ b/common/legacy_indexer.c -@@ -38,7 +38,7 @@ - extern dump_ino_t volinfo[]; // TP_NINOS - extern int tapeno; - --static int Afile = -1; /* archive file descriptor */ -+/* main.c must be able to set the fd, must not be static */ int Afile = -1; /* archive file descriptor */ - static int AfileActive = 1;/* Afile flag */ - - //extern char *Apath; ---- a/dump/main.c -+++ b/dump/main.c -@@ -104,7 +104,7 @@ char *dumpdates; /* name of the file con - char lastlevel[NUM_STR_SIZE];/* dump level of previous dump */ - char level[NUM_STR_SIZE];/* dump level of this dump */ - int zipflag; /* which compression method */ --int Afile = -1; /* archive file descriptor */ -+extern int Afile; /* archive file descriptor */ - int AfileActive = 1;/* Afile flag */ - int uflag; /* update flag */ - int mflag; /* dump metadata only if possible */ diff -Nru dump-0.4b45/debian/patches/ftruncate dump-0.4b46/debian/patches/ftruncate --- dump-0.4b45/debian/patches/ftruncate 2016-06-25 15:01:01.000000000 +0000 +++ dump-0.4b46/debian/patches/ftruncate 2016-10-04 10:52:21.000000000 +0000 @@ -1,6 +1,6 @@ --- a/restore/tape.c +++ b/restore/tape.c -@@ -1424,8 +1424,10 @@ loop: +@@ -1421,8 +1421,10 @@ loop: last_write_was_hole = 1; } if (last_write_was_hole) { @@ -13,7 +13,7 @@ } if (!readingmaps) findinode(&spcl); -@@ -1904,6 +1906,7 @@ comparefile(char *name) +@@ -1901,6 +1903,7 @@ comparefile(char *name) } else { cmperror = 0; diff -Nru dump-0.4b45/debian/patches/no_no_qfa dump-0.4b46/debian/patches/no_no_qfa --- dump-0.4b45/debian/patches/no_no_qfa 2016-06-25 15:01:01.000000000 +0000 +++ dump-0.4b46/debian/patches/no_no_qfa 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ ---- a/common/legacy_indexer.c -+++ b/common/legacy_indexer.c -@@ -235,9 +235,11 @@ legacy_openQfaState(QFA_State *s) - static int - legacy_updateQfaState(QFA_State *s) - { -+#ifdef USE_QFA - if (gTapeposfd >= 0) { - s->cntntrecs += ntrec; - } -+#endif - - return 0; - } ---- a/dump/tape.c -+++ b/dump/tape.c -@@ -1145,7 +1145,9 @@ doslave(int cmd, - transformation->startDiskIOProcess(transformation); - #endif /* HAVE_BLOCK_TRANSFORMATION */ - -+#ifdef USE_QFA - indexer->openQfaState(&qfa_state); -+#endif - - /* - * Need our own seek pointer. -@@ -1285,7 +1287,9 @@ doslave(int cmd, - ready2 = 0; - caught2 = 0; - -+#ifdef USE_QFA - indexer->updateQfa(&qfa_state); -+#endif - - while (eot_count < 10 && size < bufsize) { - #ifdef RDUMP -@@ -1339,7 +1343,9 @@ doslave(int cmd, - */ - (void) kill(nextslave, SIGUSR2); - -+#ifdef USE_QFA - indexer->updateQfaState(&qfa_state); -+#endif - } - - #ifdef HAVE_BLOCK_TRANSFORMATION ---- a/restore/restore.c -+++ b/restore/restore.c -@@ -95,8 +95,9 @@ listfile(char *name, dump_ino_t ino, int - fprintf(stdout, "%10lu\t%ld\t%lld\t%s%c", (unsigned long)ino, - tnum, tpos, name, nullflag? '\0':'\n'); - } -- else { -+ else - #endif -+ { - fprintf(stdout, "%10lu\t%s%c", (unsigned long)ino, name, - nullflag? '\0':'\n'); - } diff -Nru dump-0.4b45/debian/patches/qfa_functionality dump-0.4b46/debian/patches/qfa_functionality --- dump-0.4b45/debian/patches/qfa_functionality 2016-06-25 15:01:02.000000000 +0000 +++ dump-0.4b46/debian/patches/qfa_functionality 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ ---- a/common/legacy_indexer.c -+++ b/common/legacy_indexer.c -@@ -57,8 +57,8 @@ int magtapeout; /* is output a magnetic - //extern int magtapeout; /* is output a magnetic tape? */ - - static int gtperr = 0; --static int gTapeposfd; --static char *gTapeposfile; -+static int gTapeposfd = -1; /* code below assumes fd >= 0 means do print */ -+/* static */ char *gTapeposfile; - static char gTps[255]; - static int32_t gThisDumpDate; - #endif /* USE_QFA */ ---- a/dump/main.c -+++ b/dump/main.c -@@ -159,6 +159,7 @@ int ntrec = NTREC; /* # blocks in each t - int cartridge = 0; /* Assume non-cartridge tape */ - #ifdef USE_QFA - int tapepos = 0; /* assume no QFA tapeposition needed by user */ -+extern char *gTapeposfile; - #endif /* USE_QFA */ - int dokerberos = 0; /* Use Kerberos authentication */ - long dev_bsize = 1; /* recalculated below */ -@@ -401,7 +402,7 @@ main(int argc, char *argv[]) - - #ifdef USE_QFA - case 'Q': /* create tapeposfile */ -- //gTapeposfile = optarg; // FIXME - communicate filename to indexer. -+ gTapeposfile = optarg; // FIXME - communicate filename to indexer. - tapepos = 1; - break; - #endif /* USE_QFA */ diff -Nru dump-0.4b45/debian/patches/qfa_segfault dump-0.4b46/debian/patches/qfa_segfault --- dump-0.4b45/debian/patches/qfa_segfault 2016-06-25 15:01:02.000000000 +0000 +++ dump-0.4b46/debian/patches/qfa_segfault 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ ---- a/common/legacy_indexer.c -+++ b/common/legacy_indexer.c -@@ -358,6 +358,7 @@ Indexer indexer_legacy = { - &legacy_addDirEntry, - &legacy_openQfa, - &legacy_closeQfa, -+ &legacy_openQfaState, - &legacy_updateQfa, - &legacy_updateQfaState - }; diff -Nru dump-0.4b45/debian/patches/series dump-0.4b46/debian/patches/series --- dump-0.4b45/debian/patches/series 2016-08-21 03:40:20.000000000 +0000 +++ dump-0.4b46/debian/patches/series 2016-09-25 04:03:24.000000000 +0000 @@ -5,7 +5,3 @@ bashism_in_examples sparc-clone-lockup badentry_terminal -no_no_qfa -qfa_segfault -qfa_functionality -archive_functionality diff -Nru dump-0.4b45/debian/patches/symlinktime dump-0.4b46/debian/patches/symlinktime --- dump-0.4b45/debian/patches/symlinktime 2016-06-25 15:01:01.000000000 +0000 +++ dump-0.4b46/debian/patches/symlinktime 2016-10-09 09:33:02.000000000 +0000 @@ -1,259 +1,40 @@ --- a/restore/tape.c +++ b/restore/tape.c -@@ -484,7 +484,7 @@ getvol(long nextvol) - saved_blksread = blksread; - saved_tpblksread = tpblksread; - #if defined(USE_QFA) && defined(sunos) -- if (createtapeposflag || tapeposflag) -+ if (createtapeposflag || tapeposflag) - close(fdsmtc); +@@ -900,6 +900,15 @@ extractfile(struct entry *ep, int doremo + uid_t luid = curfile.dip->di_uid; + gid_t lgid = curfile.dip->di_gid; #endif - again: -@@ -548,7 +548,7 @@ again: - } - closemt(); - -- /* -+ /* - * if using an archive file, reset its name so readtape() - * could properly use remote access. - */ -@@ -594,7 +594,7 @@ again: - char *pos; - (void) strncpy(magtape, buf, sizeof(magtape)); - magtape[sizeof(magtape) - 1] = '\0'; -- if ((pos = strchr(magtape, '\n'))) -+ if ((pos = strchr(magtape, '\n'))) - magtape[pos - magtape] = '\0'; - } - } -@@ -787,7 +787,7 @@ printdumpinfo(void) - #endif - } - --void -+void - printvolinfo(void) - { - int i; -@@ -920,6 +920,21 @@ extractfile(struct entry *ep, int doremo - warn("%s: lchown", name); - #endif - extractattr(name); ++#ifdef HAVE_UTIMENSAT ++ struct timespec times[2]; + -+#if defined(__linux__) -+ { -+ struct timespec times[2]; -+ -+ times[0].tv_sec = timep[0].tv_sec; -+ times[0].tv_nsec = timep[0].tv_usec/1000; -+ times[1].tv_sec = timep[1].tv_sec; -+ times[1].tv_nsec = timep[1].tv_usec/1000; -+ -+ if (utimensat(AT_FDCWD, name, times, AT_SYMLINK_NOFOLLOW) < 0) -+ warn("%s: file timestamp update failed", name); -+ } ++ times[0].tv_sec = timep[0].tv_sec; ++ times[0].tv_nsec = timep[0].tv_usec*1000; ++ times[1].tv_sec = timep[1].tv_sec; ++ times[1].tv_nsec = timep[1].tv_usec*1000; +#endif + + if (! (spcl.c_flags & DR_METAONLY)) { + lnkbuf[0] = '\0'; + pathlen = 0; +@@ -919,6 +928,10 @@ extractfile(struct entry *ep, int doremo + if (lchown(name, luid, lgid) < 0) + warn("%s: lchown", name); + #endif ++#ifdef HAVE_UTIMENSAT ++ if (utimensat(AT_FDCWD, name, times, AT_SYMLINK_NOFOLLOW) < 0) ++ warn("%s: file timestamp update failed", name); ++#endif + extractattr(name); return (GOOD); } +--- a/configure.ac ++++ b/configure.ac +@@ -421,7 +421,7 @@ AC_SUBST(SQLITE3) + dnl + dnl Check for library functions + dnl +-AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown) ++AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown utimensat) + AC_CHECK_FUNC(glob) -@@ -1079,7 +1094,7 @@ extractattr(char *path) - break; - case EXT_XATTR: { - char xattr[XATTR_MAXSIZE]; -- -+ - if (readxattr(xattr) == GOOD) { - xattr_extract(path, xattr); - break; -@@ -1412,7 +1427,7 @@ loop: - if (ftruncate(ofile, origsize) < 0) - warn("%s: ftruncate", curfile.name); - } -- if (!readingmaps) -+ if (!readingmaps) - findinode(&spcl); - gettingfile = 0; - } -@@ -1525,14 +1540,14 @@ xtrcmpfile(char *buf, size_t size) - - if (cmperror) - return; -- -+ - if (read(ifile, cmpbuf, size) != (ssize_t)size) { -- fprintf(stderr, "%s: size has changed.\n", -+ fprintf(stderr, "%s: size has changed.\n", - curfile.name); - cmperror = 1; - return; - } -- -+ - if (memcmp(buf, cmpbuf, size) != 0) { - fprintf(stderr, "%s: tape and disk copies are different\n", - curfile.name); -@@ -1552,9 +1567,9 @@ xtrcmpskip(UNUSED(char *buf), size_t siz - - if (cmperror) - return; -- -+ - if (read(ifile, cmpbuf, size) != (ssize_t)size) { -- fprintf(stderr, "%s: size has changed.\n", -+ fprintf(stderr, "%s: size has changed.\n", - curfile.name); - cmperror = 1; - return; -@@ -1677,7 +1692,7 @@ cmpfiles(char *tapefile, char *diskfile, - tapefile, newname); - } - } -- -+ - /* don't unlink the file (it's not there anymore */ - /* anyway) */ - return (0); -@@ -1697,7 +1712,7 @@ static void - compareattr(char *name) - { - int xattr_done = 0; -- -+ - while (spcl.c_flags & DR_EXTATTRIBUTES) { - switch (spcl.c_extattributes) { - case EXT_MACOSFNDRINFO: -@@ -1893,7 +1908,7 @@ comparefile(char *name) - if (!cmperror) { - char c; - if (read(ifile, &c, 1) != 0) { -- fprintf(stderr, "%s: size has changed.\n", -+ fprintf(stderr, "%s: size has changed.\n", - name); - cmperror = 1; - } -@@ -1953,7 +1968,7 @@ readtape(char *buf) - static void - readtape_set(char *buf) - { -- if (!zflag) -+ if (!zflag) - readtape_func = readtape_uncompr; - else { - newcomprbuf(ntrec); -@@ -2105,13 +2120,13 @@ getmore: - - /* - * Read a compressed format block from a file or pipe and uncompress it. -- * Attempt to handle read errors, and end of file. -+ * Attempt to handle read errors, and end of file. - */ - static void - readtape_comprfile(char *buf) - { - long rl, size, i, ret; -- int newvol; -+ int newvol; - struct tapebuf *tpb; - - if (blkcnt < numtrec) { -@@ -2319,7 +2334,7 @@ decompress_tapebuf(struct tapebuf *tpbin - #ifndef HAVE_ZLIB - errx(1,"This restore version doesn't support zlib decompression"); - #else -- cresult = uncompress(comprbuf, &worklen, -+ cresult = uncompress(comprbuf, &worklen, - tpbin->buf, blocklen); - output = comprbuf; - switch (cresult) { -@@ -2349,7 +2364,7 @@ decompress_tapebuf(struct tapebuf *tpbin - #else - unsigned int worklen2 = worklen; - cresult = BZ2_bzBuffToBuffDecompress( -- comprbuf, &worklen2, -+ comprbuf, &worklen2, - tpbin->buf, blocklen, 0, 0); - worklen = worklen2; - output = comprbuf; -@@ -2457,7 +2472,7 @@ msg_read_error(char *m) - * readtape_set can set the correct function pointer for readtape(). - * Note that the first block of each tape/file is not compressed - * and does not have a prefix. -- */ -+ */ - static void - findtapeblksize(void) - { -@@ -2485,7 +2500,7 @@ findtapeblksize(void) - cvtflag++; - if (converthead(&spclpt) == FAIL) { - /* Special case for old compressed tapes with prefix */ -- if (magtapein && (i % TP_BSIZE != 0)) -+ if (magtapein && (i % TP_BSIZE != 0)) - goto oldformat; - errx(1, "Tape is not a dump tape"); - } -@@ -2508,7 +2523,7 @@ findtapeblksize(void) - "\'-b %d\' ", spclpt.c_ntrec); - ntrec = spclpt.c_ntrec; - len = (ntrec - 1) * TP_BSIZE; -- zflag = 1; -+ zflag = 1; - } - else { - /* read in the rest of the block based on bufsize */ -@@ -2526,7 +2541,7 @@ findtapeblksize(void) - /* - * If the input is a tape, we tried to read ntrec * TP_BSIZE bytes. - * If the value of ntrec is too large, we read less than -- * what we asked for; adjust the value of ntrec and test for -+ * what we asked for; adjust the value of ntrec and test for - * a compressed dump tape. - */ - if (i % TP_BSIZE != 0) { -@@ -2580,7 +2595,7 @@ static int read_a_block(int fd, char *bu - i = rmtread(buf, size); - else - #endif -- i = read(fd, buf, size); -+ i = read(fd, buf, size); - - if (i <= 0) - break; /* EOD or error */ -@@ -2768,7 +2783,7 @@ good: - buf->c_dinode.di_size = buf->c_count * TP_BSIZE; - if (buf->c_count > TP_NINDIR) - readmapflag = 1; -- else -+ else - for (i = 0; i < buf->c_count; i++) - buf->c_addr[i]++; - break; -@@ -2817,7 +2832,7 @@ converttapebuf(struct tapebuf *tpb) - unsigned int compressed:1; - } tb; - swabst((u_char *)"i", (u_char *)tpb); -- memcpy(&tb, tpb, 4); -+ memcpy(&tb, tpb, 4); - tpb->length = tb.length; - tpb->flags = tb.flags; - tpb->compressed = tb.compressed; -@@ -3258,7 +3273,7 @@ GetTapePos(long long *pos) - } - if (err) { - err = errno; -- fprintf(stdout, "[%ld] error: %d (getting tapepos: %lld)\n", -+ fprintf(stdout, "[%ld] error: %d (getting tapepos: %lld)\n", - (unsigned long)getpid(), err, *pos); - return err; - } -@@ -3292,7 +3307,7 @@ GotoTapePos(long long pos) - } - if (err) { - err = errno; -- fprintf(stdout, "[%ld] error: %d (setting tapepos: %lld)\n", -+ fprintf(stdout, "[%ld] error: %d (setting tapepos: %lld)\n", - (unsigned long)getpid(), err, pos); - return err; - } + dnl diff -Nru dump-0.4b45/debian/patches/zerosep dump-0.4b46/debian/patches/zerosep --- dump-0.4b45/debian/patches/zerosep 2016-06-25 15:01:01.000000000 +0000 +++ dump-0.4b46/debian/patches/zerosep 2016-10-04 10:23:10.000000000 +0000 @@ -27,6 +27,15 @@ default: usage(); } +@@ -729,7 +733,7 @@ usage(void) + "\t%s [-f file] [-F script] [-s fileno] [-T directory]\n" + "\t%s -R [-cd" tseflag "H" kerbflag "lMuvVy] [-b blocksize] " tsEflag"\n" + "\t%s [-f file] [-F script] [-s fileno] [-T directory]\n" +- "\t%s -t [-cdhH" kerbflag "lMuvVy] [-A file] [-b blocksize]\n" ++ "\t%s -t [-cdhH" kerbflag "lMuvVy0] [-A file] [-b blocksize]\n" + "\t%s [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n" + "\t%s -x [-acd" tseflag "hH" kerbflag "lmMouvVy] [-A file] [-b blocksize] " tsEflag"\n" + "\t%s [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n", --- a/restore/restore.8.in +++ b/restore/restore.8.in @@ -29,7 +29,7 @@ @@ -591,121 +600,23 @@ .PP --- a/restore/restore.c +++ b/restore/restore.c -@@ -92,12 +92,14 @@ listfile(char *name, dump_ino_t ino, int +@@ -92,12 +92,13 @@ listfile(char *name, dump_ino_t ino, int #ifdef USE_QFA if (tapeposflag) { /* add QFA positions to output */ (void)Inode2Tapepos(ino, &tnum, &tpos, 1); -- fprintf(stdout, "%10lu\t%ld\t%lld\t%s\n", (unsigned long)ino, +- fprintf(stdout, "%10lu\t%ld\t%lld\t%s\n", (unsigned long)ino, - tnum, tpos, name); + fprintf(stdout, "%10lu\t%ld\t%lld\t%s%c", (unsigned long)ino, + tnum, tpos, name, nullflag? '\0':'\n'); } -- else -+ else { + else #endif - fprintf(stdout, "%10lu\t%s\n", (unsigned long)ino, name); + fprintf(stdout, "%10lu\t%s%c", (unsigned long)ino, name, -+ nullflag? '\0':'\n'); -+ } ++ nullflag? '\0': '\n'); return (descend); } -@@ -725,7 +727,7 @@ compareleaves(void) - /* - * If we find files on the tape that have no corresponding - * directory entries, then we must have found a file that -- * was created while the dump was in progress. Since we have -+ * was created while the dump was in progress. Since we have - * no name for it, we discard it knowing that it will be - * on the next incremental tape. - */ -@@ -759,8 +761,8 @@ compareleaves(void) - /* - * If we encounter the end of the tape and the next available - * file is not the one which we expect then we have missed one -- * or more files. Since we do not request files that were not -- * on the tape, the lost files must have been due to a tape -+ * or more files. Since we do not request files that were not -+ * on the tape, the lost files must have been due to a tape - * read error, or a file that was removed while the dump was - * in progress. - */ -@@ -769,7 +771,7 @@ compareleaves(void) - ep = lookupino(first); - if (ep == NULL) - panic("%d: bad first\n", first); -- fprintf(stderr, "%s: (inode %lu) not found on tape\n", -+ fprintf(stderr, "%s: (inode %lu) not found on tape\n", - myname(ep), (unsigned long)first); - do_compare_error; - ep->e_flags &= ~(NEW|EXTRACT); -@@ -810,7 +812,7 @@ createleaves(char *symtabfile) - ep = lookupino(first); - if (ep == NULL) - panic("%d: bad first\n", first); -- fprintf(stderr, "%s: (inode %lu) not found on tape\n", -+ fprintf(stderr, "%s: (inode %lu) not found on tape\n", - myname(ep), (unsigned long)first); - ep->e_flags &= ~(NEW|EXTRACT); - first = lowerbnd(first); -@@ -861,8 +863,8 @@ next: - /* - * If we encounter the end of the tape and the next available - * file is not the one which we expect then we have missed one -- * or more files. Since we do not request files that were not -- * on the tape, the lost files must have been due to a tape -+ * or more files. Since we do not request files that were not -+ * on the tape, the lost files must have been due to a tape - * read error, or a file that was removed while the dump was - * in progress. - */ -@@ -871,7 +873,7 @@ next: - ep = lookupino(first); - if (ep == NULL) - panic("%d: bad first\n", first); -- fprintf(stderr, "%s: (inode %lu) not found on tape\n", -+ fprintf(stderr, "%s: (inode %lu) not found on tape\n", - myname(ep), (unsigned long)first); - do_compare_error; - ep->e_flags &= ~(NEW|EXTRACT); -@@ -937,7 +939,7 @@ createfiles(void) - ep = lookupino(next); - if (ep == NULL) - panic("corrupted symbol table\n"); -- fprintf(stderr, "%s: (inode %lu) not found on tape\n", -+ fprintf(stderr, "%s: (inode %lu) not found on tape\n", - myname(ep), (unsigned long)next); - ep->e_flags &= ~NEW; - next = lowerbnd(next); -@@ -966,7 +968,7 @@ createfiles(void) - volChg = 0; - } - if (GetTapePos(&curtpos) == 0) { -- /* curtpos +1000 ???, some drives -+ /* curtpos +1000 ???, some drives - * might be too slow */ - if (((tpos > (curtpos + 1000)) && (volChg == 0)) || ((tpos != curtpos) && (volChg == 1))) { - volChg = 0; -@@ -1023,8 +1025,8 @@ createfiles(void) - titaken = tiend - tistart; - #ifdef DEBUG_QFA - if (titaken / 60 > 0) -- msg("%ld reads took %d:%02d:%02d\n", -- tmpcnt, titaken / 3600, -+ msg("%ld reads took %d:%02d:%02d\n", -+ tmpcnt, titaken / 3600, - (titaken % 3600) / 60, titaken % 60); - #endif - #endif /* USE_QFA */ -@@ -1052,7 +1054,7 @@ createfiles(void) - #ifdef USE_QFA - if (!createtapeposflag) - #endif -- fprintf(stderr, "%s: (inode %lu) not found on tape\n", -+ fprintf(stderr, "%s: (inode %lu) not found on tape\n", - myname(ep), (unsigned long)next); - ep->e_flags &= ~NEW; - next = lowerbnd(next); --- a/restore/restore.h +++ b/restore/restore.h @@ -62,6 +62,7 @@ extern int uflag; /* unlink symlink tar diff -Nru dump-0.4b45/debian/rules dump-0.4b46/debian/rules --- dump-0.4b45/debian/rules 2016-06-25 15:01:01.000000000 +0000 +++ dump-0.4b46/debian/rules 2016-10-20 09:23:22.000000000 +0000 @@ -10,7 +10,8 @@ --prefix=/usr \ --sbindir=/sbin \ --with-ccopts="-O2 -g -Wall" \ - --with-dumpdatespath=/var/lib/dumpdates + --with-dumpdatespath=/var/lib/dumpdates \ + --enable-lzo --enable-bzip2 --enable-zlib override_dh_auto_install: dh_auto_install -- \ @@ -27,4 +28,4 @@ ln -s dump.8.gz rdump.8.gz ; ln -s restore.8.gz rrestore.8.gz ) %: - dh $@ + dh $@ --with autoreconf diff -Nru dump-0.4b45/dump/dump.h dump-0.4b46/dump/dump.h --- dump-0.4b45/dump/dump.h 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/dump/dump.h 2016-06-08 05:01:45.000000000 +0000 @@ -271,4 +271,3 @@ extern const char *strerror(); #endif - diff -Nru dump-0.4b45/dump/itime.c dump-0.4b46/dump/itime.c --- dump-0.4b45/dump/itime.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/dump/itime.c 2016-06-08 05:01:45.000000000 +0000 @@ -164,7 +164,7 @@ spcl.c_ddate = 0; memset(&lastlevel, 0, NUM_STR_SIZE); - /* If this is a level 0 dump, and we're not updating + /* If this is a level 0 dump, and we're not updating dumpdates, there's no point in trying to read dumpdates. It may not exist yet, or may not be mounted. For incrementals, we *must* read dumpdates (fail if it's not there!) */ diff -Nru dump-0.4b45/dump/main.c dump-0.4b46/dump/main.c --- dump-0.4b45/dump/main.c 2016-05-09 05:46:35.000000000 +0000 +++ dump-0.4b46/dump/main.c 2016-09-05 18:37:56.000000000 +0000 @@ -105,7 +105,6 @@ char level[NUM_STR_SIZE];/* dump level of this dump */ int zipflag; /* which compression method */ int Afile = -1; /* archive file descriptor */ -int AfileActive = 1;/* Afile flag */ int uflag; /* update flag */ int mflag; /* dump metadata only if possible */ int Mflag; /* multi-volume flag */ @@ -159,6 +158,7 @@ int cartridge = 0; /* Assume non-cartridge tape */ #ifdef USE_QFA int tapepos = 0; /* assume no QFA tapeposition needed by user */ +extern const char *gTapeposfile; #endif /* USE_QFA */ int dokerberos = 0; /* Use Kerberos authentication */ long dev_bsize = 1; /* recalculated below */ @@ -268,7 +268,7 @@ case '5': case '6': case '7': case '8': case '9': if ((pch >= '0') && (pch <= '9') && (strlen(level) < NUM_STR_SIZE)) level[strlen(level)] = ch; - else + else level[0] = ch; pch = ch; break; @@ -315,7 +315,7 @@ case 'D': /* path of dumpdates file */ dumpdates = optarg; break; - + /* 04-Feb-00 ILC */ case 'e': /* exclude an inode */ { @@ -355,8 +355,8 @@ break; #endif /* HAVE_BZLIB */ - case 'I': - breademax = + case 'I': + breademax = numarg ("number of errors to ignore", 0L, 0L); break; @@ -401,11 +401,11 @@ #ifdef USE_QFA case 'Q': /* create tapeposfile */ - //gTapeposfile = optarg; // FIXME - communicate filename to indexer. + gTapeposfile = optarg; tapepos = 1; break; #endif /* USE_QFA */ - + case 's': /* tape size, feet */ unlimited = 0; tsize = numarg("tape size", 1L, 0L) * 12 * 10; @@ -423,7 +423,7 @@ exit(X_STARTUP); } Tflag = 1; - lastlevel[0] = '?'; lastlevel[1] = '\0'; + lastlevel[0] = '?'; lastlevel[1] = '\0'; break; case 'u': /* update dumpdates */ @@ -440,8 +440,8 @@ exit(X_FINOK); /* do nothing else */ #ifdef HAVE_LZO case 'y': - compressed = 2; - transformation = transformation_lzo_factory(1); + compressed = 2; + transformation = transformation_lzo_factory(1); zipflag = COMPRESS_LZO; break; #endif /* HAVE_LZO */ @@ -662,10 +662,10 @@ spcl.c_level = atoi(level); spcl.c_type = TS_TAPE; if (!Tflag) - getdumptime(uflag); /* 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: There is no inferior level dump on this filesystem\n"); msg("WARNING: Assuming a level 0 dump by default\n"); level[0] = '0'; level[1] = '\0'; spcl.c_level = 0; @@ -768,7 +768,7 @@ dumpdirmap = (char *)calloc((unsigned) mapsize, sizeof(char)); dumpinomap = (char *)calloc((unsigned) mapsize, sizeof(char)); metainomap = (char *)calloc((unsigned) mapsize, sizeof(char)); - if (usedinomap == NULL || dumpdirmap == NULL || + if (usedinomap == NULL || dumpdirmap == NULL || dumpinomap == NULL || metainomap == NULL) quit("out of memory allocating inode maps\n"); tapesize = 2 * (howmany(mapsize * sizeof(char), TP_BSIZE) + 1); @@ -777,11 +777,11 @@ if (!sizest) { msg("Label: %s\n", spcl.c_label); - + msg("Writing %d Kilobyte records\n", ntrec); if (compressed) { - if (zipflag == COMPRESS_LZO) + if (zipflag == COMPRESS_LZO) msg("Compressing output (lzo)\n"); else msg("Compressing output at transformation level %d (%s)\n", @@ -806,10 +806,10 @@ } filedev = statbuf.st_dev; if (!(statbuf.st_mode & S_IFDIR)) /* is a file */ - anydirskipped = maponefile(maxino, &tapesize, + anydirskipped = maponefile(maxino, &tapesize, directory); else - anydirskipped = mapfilesfromdir(maxino, &tapesize, + anydirskipped = mapfilesfromdir(maxino, &tapesize, directory); } while (argc--) { @@ -821,7 +821,7 @@ msg("The ENTIRE dump is aborted.\n"); exit(X_STARTUP); } - /* check if file is on same unix partiton as the first + /* check if file is on same unix partiton as the first * argument */ if (statbuf.st_dev != filedev) { msg("Files are not on same file system (%s).\n", p); @@ -830,19 +830,19 @@ } /* check if file is a directory */ if (!(statbuf.st_mode & S_IFDIR)) - anydirskipped2 = maponefile(maxino, &tapesize, + anydirskipped2 = maponefile(maxino, &tapesize, p+strlen(dt->mnt_dir)); else /* read directory inodes. - * NOTE: nested directories are not recognized + * NOTE: nested directories are not recognized * so inodes may be umped twice! */ - anydirskipped2 = mapfilesfromdir(maxino, &tapesize, + anydirskipped2 = mapfilesfromdir(maxino, &tapesize, p+strlen(dt->mnt_dir)); if (!anydirskipped) anydirskipped = anydirskipped2; argv++; - } + } #else anydirskipped = mapfiles(maxino, &tapesize); #endif @@ -1015,7 +1015,7 @@ ((double)spcl.c_tapea * TP_BSIZE / 1048576)); else msg("%ld blocks (%.2fMB) on %d volume(s)\n", - spcl.c_tapea, + spcl.c_tapea, ((double)spcl.c_tapea * TP_BSIZE / 1048576), spcl.c_volume); @@ -1090,7 +1090,7 @@ "[-z zlevel] " #endif "filesystem\n" - "\t%s [-W | -w]\n", + "\t%s [-W | -w]\n", __progname, white, white, white, __progname); exit(X_STARTUP); } @@ -1315,9 +1315,9 @@ } else { unsigned int oldsize = iexclude_bitmap_bytes; - iexclude_bitmap_bytes *= + iexclude_bitmap_bytes *= (ino / 8 + 1) / iexclude_bitmap_bytes + 1; - iexclude_bitmap = (char*) realloc(iexclude_bitmap, + iexclude_bitmap = (char*) realloc(iexclude_bitmap, iexclude_bitmap_bytes); if (iexclude_bitmap == NULL) { msg("allocating memory failed\n"); @@ -1327,12 +1327,13 @@ iexclude_bitmap[oldsize] = 0; } } - + iexclude_bitmap[ino / 8] |= 1 << (ino % 8); } static void -do_exclude_ino_str(char * ino) { +do_exclude_ino_str(char * ino) +{ char *r; unsigned long inod; @@ -1348,11 +1349,11 @@ /* * This reads a file containing one inode number per line and exclude them all */ -static void -do_exclude_from_file(char *file) { +static void +do_exclude_from_file(char *file) +{ FILE *f; char *p, fname[MAXPATHLEN]; - if (!( f = fopen(file, "r")) ) { msg("Cannot open file for reading: %s\n", file); @@ -1369,9 +1370,10 @@ fclose(f); } -static void incompat_flags(int cond, char flag1, char flag2) { +static void incompat_flags(int cond, char flag1, char flag2) +{ if (cond) { - msg("You cannot use the %c and %c flags together.\n", + msg("You cannot use the %c and %c flags together.\n", flag1, flag2); msg("The ENTIRE dump is aborted.\n"); exit(X_STARTUP); diff -Nru dump-0.4b45/dump/Makefile.in dump-0.4b46/dump/Makefile.in --- dump-0.4b45/dump/Makefile.in 2016-05-09 06:36:02.000000000 +0000 +++ dump-0.4b46/dump/Makefile.in 2016-09-05 19:25:28.000000000 +0000 @@ -274,7 +274,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ -SSLLIB = @SSLLIB@ +SSL_CFLAGS = @SSL_CFLAGS@ +SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ diff -Nru dump-0.4b45/dump/optr.c dump-0.4b46/dump/optr.c --- dump-0.4b45/dump/optr.c 2016-05-09 05:38:01.000000000 +0000 +++ dump-0.4b46/dump/optr.c 2016-09-05 19:00:49.000000000 +0000 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -431,6 +432,18 @@ struct stat buf, tabbuf; struct pfstab *tabpf; struct mntent *tabfs; + char **type; + bool known_fs; + + /* Discard fstypes we don't handle */ + if (fs->mnt_type == NULL) + return NULL; + + known_fs = false; + for (type = fstypes; *type != NULL && known_fs == false; ++type) + known_fs = (strcmp(fs->mnt_type, *type) == 0); + if (!known_fs) + return NULL; new = (struct mntent *)malloc(sizeof (*fs)); if (new == NULL) @@ -455,7 +468,7 @@ quit("Cannot access %s\n", tabfs->mnt_fsname); if (tabbuf.st_rdev == buf.st_rdev) { free(new); - /* Copy passno and freq from /etc/fstab because + /* Copy passno and freq from /etc/fstab because * /etc/mtab does always have them as 0 0 */ if (!tabfs->mnt_passno) tabfs->mnt_passno = fs->mnt_passno; @@ -467,7 +480,7 @@ return NULL; } } - + if (strlen(fs->mnt_dir) > 1 && fs->mnt_dir[strlen(fs->mnt_dir) - 1] == '/') fs->mnt_dir[strlen(fs->mnt_dir) - 1] = '\0'; if ((new->mnt_dir = strdup(fs->mnt_dir)) == NULL || @@ -509,7 +522,7 @@ quit("%s\n", strerror(errno)); pf->pf_mntent = fs; pf->pf_next = NULL; - + /* keep table in /etc/fstab order for use with -w and -W */ if (pfold) { pfold->pf_next = pf; @@ -680,7 +693,7 @@ * dump level was x-3660 * * Negative values indicate that the fs is - * not to be dumped, and the latest dump + * not to be dumped, and the latest dump * level was -x-1 */ dt->mnt_passno = dtwalk->dd_ddate; @@ -702,6 +715,10 @@ struct mntent *dt = pf->pf_mntent; char **type; + /* Skip fstypes we don't handle */ + if (dt->mnt_type == NULL) + continue; + for (type = fstypes; *type != NULL; type++) { if (strcmp(dt->mnt_type, *type) == 0) { const char *disk = get_device_name(dt->mnt_fsname); diff -Nru dump-0.4b45/dump/tape.c dump-0.4b46/dump/tape.c --- dump-0.4b45/dump/tape.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/dump/tape.c 2016-06-08 14:51:51.000000000 +0000 @@ -128,7 +128,7 @@ char (*nextblock)[TP_BSIZE]; -static time_t tstart_volume; /* time of volume start */ +static time_t tstart_volume; /* time of volume start */ static int tapea_volume; /* value of spcl.c_tapea at volume start */ int master; /* pid of master, for sending error signals */ @@ -284,7 +284,7 @@ quit("Cannot recover\n"); /* NOTREACHED */ } - msg("write error %d blocks into volume %d: %s\n", + msg("write error %d blocks into volume %d: %s\n", blocksthisvol, tapeno, strerror(errnum)); broadcast("DUMP WRITE ERROR!\n"); if (query("Do you want to rewrite this volume?")) { @@ -322,7 +322,7 @@ blocks = spcl.c_tapea - tapea_volume; msg("Volume %d completed at: %s", tapeno, ctime(&tnow)); if (! compressed) - msg("Volume %d %ld blocks (%.2fMB)\n", tapeno, + msg("Volume %d %ld blocks (%.2fMB)\n", tapeno, blocks, ((double)blocks * TP_BSIZE / 1048576)); if (ttaken > 0) { long volkb = (bytes_written - tapea_bytes) / 1024; @@ -398,7 +398,7 @@ int siz = (char *)nextblock - (char *)slp->req; - /* make sure returned has sane values in case we don't read + /* make sure returned has sane values in case we don't read * them from the slave in this pass */ returned.unclen = returned.clen = writesize; @@ -544,7 +544,7 @@ sleep(10); rmtclose(); } - else + else #endif { (void) close(tapefd); @@ -558,7 +558,7 @@ return do_stats(); } - + void close_rewind(void) { @@ -602,7 +602,7 @@ tslp = &slaves[SLAVES]; ntb = (union u_spcl *)tslp->tblock[1]; - /* make sure returned has sane values in case we don't read + /* make sure returned has sane values in case we don't read * them from the slave in this pass */ returned.unclen = returned.clen = writesize; @@ -880,15 +880,15 @@ if (blocksperfiles && blocksperfiles_current < *blocksperfiles) blocksperfiles_current++; #ifdef RDUMP - while ((tapefd = (host ? rmtopen(tape, O_WRONLY|O_CREAT|O_TRUNC) : pipeout ? - fileno(stdout) : + while ((tapefd = (host ? rmtopen(tape, O_WRONLY|O_CREAT|O_TRUNC) : pipeout ? + fileno(stdout) : open(tape, O_WRONLY|O_CREAT|O_TRUNC, 0666))) < 0) #else while ((tapefd = (pipeout ? fileno(stdout) : open(tape, O_WRONLY|O_CREAT|O_TRUNC, 0666))) < 0) #endif { - msg("Cannot open output \"%s\": %s\n", tape, + msg("Cannot open output \"%s\": %s\n", tape, strerror(errno)); if (!query("Do you want to retry the open?")) dumpabort(0); @@ -900,7 +900,7 @@ struct mtget mt_stat; magtapeout = ioctl(tapefd, MTIOCGET, (char *)&mt_stat) == 0; /* - msg("Output is to %s\n", + msg("Output is to %s\n", magtapeout ? "tape" : "file/pipe"); */ } @@ -925,7 +925,7 @@ spcl.c_flags |= DR_COMPRESSED; writeheader((dump_ino_t)slp->inode); spcl.c_flags &=~ DR_NEWHEADER; - msg("Volume %d started with block %ld at: %s", tapeno, + msg("Volume %d started with block %ld at: %s", tapeno, spcl.c_tapea, ctime(&tstart_volume)); if (tapeno > 1) msg("Volume %d begins with blocks from inode %d\n", @@ -1044,9 +1044,9 @@ != sizeof i) quit("master/slave protocol botched 3\n"); #endif - doslave(cmd[0], + doslave(cmd[0], #ifdef WRITEDEBUG - i, + i, #endif (slaves[i].pid == slp->pid)); Exit(X_FINOK); @@ -1067,11 +1067,11 @@ #endif for (i = 0; i < SLAVES; i++) - (void) dump_atomic_write( slaves[i].fd, - (char *) &slaves[(i + 1) % SLAVES].pid, + (void) dump_atomic_write( slaves[i].fd, + (char *) &slaves[(i + 1) % SLAVES].pid, sizeof slaves[0].pid); - - master = 0; + + master = 0; } void @@ -1096,9 +1096,9 @@ * and moves to the compression phase. */ static void -doslave(int cmd, +doslave(int cmd, #ifdef WRITEDEBUG - int slave_number, + int slave_number, #endif int first) { @@ -1132,7 +1132,9 @@ transformation->startDiskIOProcess(transformation); #endif /* HAVE_BLOCK_TRANSFORMATION */ +#ifdef USE_QFA indexer->openQfaState(&qfa_state); +#endif /* * Need our own seek pointer. @@ -1175,9 +1177,9 @@ comp_buf->flags = COMPRESS_ZLIB; else if (zipflag == COMPRESS_BZLIB) comp_buf->flags = COMPRESS_BZLIB; - else if (zipflag == COMPRESS_LZO) + else if (zipflag == COMPRESS_LZO) comp_buf->flags = COMPRESS_LZO; - else + else quit("internal error - unknown compression method: %d\n", zipflag); } #endif /* HAVE_BLOCK_TRANSFORMATION */ @@ -1199,7 +1201,7 @@ for (trecno = 0; trecno < ntrec; trecno += p->count, p += p->count) { - + if (p->dblk) { /* read a disk block */ bread(p->dblk, slp->tblock[trecno], p->count * TP_BSIZE); @@ -1222,7 +1224,7 @@ returns.clen = returns.unclen = bufsize; #if defined(HAVE_BLOCK_TRANSFORMATION) - /* + /* * When writing a compressed dump, each block except * the first one on each tape is written * from struct tapebuf with an 4 byte prefix @@ -1272,8 +1274,10 @@ ready2 = 0; caught2 = 0; +#ifdef USE_QFA indexer->updateQfa(&qfa_state); - +#endif + while (eot_count < 10 && size < bufsize) { #ifdef RDUMP if (host) @@ -1326,7 +1330,9 @@ */ (void) kill(nextslave, SIGUSR2); +#ifdef USE_QFA indexer->updateQfaState(&qfa_state); +#endif } #ifdef HAVE_BLOCK_TRANSFORMATION @@ -1383,7 +1389,7 @@ buf.mt_count = MT_ST_BOOLEANS | MT_ST_SCSI2LOGICAL; if (ioctl(tapefd, MTIOCTOP, &buf) == -1) { err = errno; - msg("[%ld] error: %d (setting logical)\n", + msg("[%ld] error: %d (setting logical)\n", (unsigned long)getpid(), err); } return err; diff -Nru dump-0.4b45/dump/traverse.c dump-0.4b46/dump/traverse.c --- dump-0.4b45/dump/traverse.c 2016-05-09 04:32:07.000000000 +0000 +++ dump-0.4b46/dump/traverse.c 2016-06-08 05:01:45.000000000 +0000 @@ -153,7 +153,7 @@ } else { if (es->s_feature_compat & - EXT3_FEATURE_COMPAT_HAS_JOURNAL && + EXT3_FEATURE_COMPAT_HAS_JOURNAL && journal_ino) do_exclude_ino(journal_ino, "journal inode"); do_exclude_ino(EXT2_RESIZE_INO, "resize inode"); @@ -198,7 +198,7 @@ if ((dp->di_mode & IFMT) == IFDIR) { /* * for directories, assume only half of space is filled - * with entries. + * with entries. */ blkest = blkest / 2; sizeest = sizeest / 2; @@ -378,10 +378,10 @@ if (directory[i] == '/') { strncpy (dir_name, directory, i); dir_name[i] = '\0'; - retval = ext2fs_namei(fs, ROOTINO, ROOTINO, + retval = ext2fs_namei(fs, ROOTINO, ROOTINO, dir_name, &dir_ino); if (retval) { - com_err(disk, retval, + com_err(disk, retval, "while translating %s", dir_name); exit(X_ABORT); } @@ -417,7 +417,7 @@ }; static int -mapfilesindir(struct ext2_dir_entry *dirent, UNUSED(int offset), +mapfilesindir(struct ext2_dir_entry *dirent, UNUSED(int offset), UNUSED(int blocksize), UNUSED(char *buf), void *private) { struct dinode const *dp; @@ -557,7 +557,7 @@ * If dir has been removed from the used map, it's either * because it had the nodump flag, or it herited it from * its parent. A directory can't be in dumpinomap if not - * in usedinomap, but we have to go through it anyway + * in usedinomap, but we have to go through it anyway * to propagate the nodump attribute. */ if ((isdir & 1) == 0) @@ -654,7 +654,7 @@ */ #ifdef __linux__ static int -searchdir(struct ext2_dir_entry *dp, UNUSED(int offset), +searchdir(struct ext2_dir_entry *dp, UNUSED(int offset), UNUSED(int blocksize), UNUSED(char *buf), void *private) { struct mapdirs_context *mdc; @@ -810,7 +810,7 @@ msg("dumping EA (inode) in inode #%ld\n", (long)ino); memset(xattr, 0, EXT2_INODE_SIZE(fs->super)); memcpy(xattr, (void *)magic, - EXT2_INODE_SIZE(fs->super) - + EXT2_INODE_SIZE(fs->super) - (EXT2_GOOD_OLD_INODE_SIZE + dp->di_extraisize)); magic = (u_int32_t *)xattr; *magic = EXT2_XATTR_MAGIC2; @@ -866,10 +866,10 @@ int ind_level; #endif uint64_t i_size; - + if (metaonly) i_size = 0; - else + else i_size = dp->di_size + ((uint64_t) dp->di_size_high << 32); if (newtape) { @@ -1034,7 +1034,7 @@ * size of the entry, and creates it in a temporary buffer */ static int -convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset), +convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset), UNUSED(int blocksize), UNUSED(char *buf), void *private) { struct convert_dir_context *p; @@ -1218,7 +1218,7 @@ if (blk != 0) { bread(fsbtodb(sblock, blk), (char *)idblk, (int) sblock->fs_bsize); #ifdef __linux__ - /* + /* * My RedHat 4.0 system doesn't have these flags; I haven't * upgraded e2fsprogs yet */ @@ -1314,11 +1314,11 @@ #define int32_t __s32 #endif -/* +/* * Compute and fill in checksum information. */ void -mkchecksum(union u_spcl *tmpspcl) +mkchecksum(union u_spcl *tmpspcl) { int32_t sum, cnt, *lp; @@ -1425,7 +1425,7 @@ } if (cnt == -1) msg("read error from %s: %s: [block %d, ext2blk %d]: count=%d\n", - disk, strerror(errno), blkno, + disk, strerror(errno), blkno, dbtofsb(sblock, blkno), size); else msg("short read error from %s: [block %d, ext2blk %d]: count=%d, got=%d\n", @@ -1458,7 +1458,7 @@ continue; if (cnt == -1) { msg("read error from %s: %s: [sector %d, ext2blk %d]: count=%d\n", - disk, strerror(errno), blkno, + disk, strerror(errno), blkno, dbtofsb(sblock, blkno), dev_bsize); continue; } diff -Nru dump-0.4b45/dump.lsm dump-0.4b46/dump.lsm --- dump-0.4b45/dump.lsm 2016-05-09 06:35:33.000000000 +0000 +++ dump-0.4b46/dump.lsm 2016-09-05 19:25:32.000000000 +0000 @@ -1,13 +1,13 @@ Begin3 Title: dump and restore for Ext2fs -Version: 0.4b45 +Version: 0.4b46 Entered-date: 09MAY16 Description: Port of the 4.4BSD dump and restore backup suite Keywords: backup, filesystem, Ext2fs Author: University of California, Berkeley Maintained-by: stelian@popies.net (Stelian Pop) Primary-site: http://dump.sourceforge.net/ - 0kB dump-0.4b45.tar.gz + 0kB dump-0.4b46.tar.gz 0 dump.lsm Original-site: ftp.freebsd.org /pub/bsd-sources/4.4BSD-Lite2/sbin dump/* diff -Nru dump-0.4b45/dump.lsm.in dump-0.4b46/dump.lsm.in --- dump-0.4b45/dump.lsm.in 1970-01-01 00:00:00.000000000 +0000 +++ dump-0.4b46/dump.lsm.in 2016-09-05 19:18:25.000000000 +0000 @@ -0,0 +1,18 @@ +Begin3 +Title: dump and restore for Ext2fs +Version: @VERSION@ +Entered-date: 09MAY16 +Description: Port of the 4.4BSD dump and restore backup suite +Keywords: backup, filesystem, Ext2fs +Author: University of California, Berkeley +Maintained-by: stelian@popies.net (Stelian Pop) +Primary-site: http://dump.sourceforge.net/ + 0kB dump-@VERSION@.tar.gz + 0 dump.lsm +Original-site: ftp.freebsd.org /pub/bsd-sources/4.4BSD-Lite2/sbin + dump/* + restore/* +Platforms: linux 2.0.x, linux 2.2.x, linux 2.4.x, linux 2.6.x + e2fsprogs 1.14 or better +Copying-policy: BSD +End diff -Nru dump-0.4b45/Makefile.in dump-0.4b46/Makefile.in --- dump-0.4b45/Makefile.in 2016-05-09 06:36:02.000000000 +0000 +++ dump-0.4b46/Makefile.in 2016-09-05 19:25:28.000000000 +0000 @@ -82,8 +82,9 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in COPYING TODO compile config.guess \ - config.sub install-sh missing ltmain.sh + $(srcdir)/config.h.in $(srcdir)/dump.lsm.in COPYING TODO \ + compile config.guess config.sub depcomp install-sh missing \ + ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -95,7 +96,7 @@ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = dump.lsm CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -274,7 +275,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ -SSLLIB = @SSLLIB@ +SSL_CFLAGS = @SSL_CFLAGS@ +SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ @@ -417,6 +419,8 @@ distclean-hdr: -rm -f config.h stamp-h1 +dump.lsm: $(top_builddir)/config.status $(srcdir)/dump.lsm.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo diff -Nru dump-0.4b45/NEWS dump-0.4b46/NEWS --- dump-0.4b45/NEWS 2016-05-09 06:35:33.000000000 +0000 +++ dump-0.4b46/NEWS 2016-09-05 19:25:05.000000000 +0000 @@ -1,3 +1,20 @@ +Changes between versions 0.4b45 and 0.4b46 (released Sep 05, 2016) +=================================================================== + +1. Use pkg-config to locate openssl dependencies to fix ermt linking. + +2. Fix building when QFA code is disabled (Alexander Zangerl). + +3. Fix crash with the -Q option (Alexander Zangerl). + +4. Fix crash with legacy indexer (Alexander Zangerl). + +5. Fix handling of the -A flag. + +6. Fix compression enabling logic (Alexander Zangerl). + +7. Skip unhandled fstab entries (Josef Ridky). + Changes between versions 0.4b44 and 0.4b45 (released May 09, 2016) =================================================================== @@ -123,7 +140,7 @@ for reporting the bug. 3. Enable restore to handle restoring onto a different SELinux - policy from the dump. Thanks to Tony Nelson + policy from the dump. Thanks to Tony Nelson for the patch. (see http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=189845 for details) @@ -214,7 +231,7 @@ ================================================================= 1. Changed restore to emit warnings (instead of emitting a fatal - error) if a file (or a directory) is unavailable for a + error) if a file (or a directory) is unavailable for a comparision (if the user doesn't have the necessary permissions to access it for example). Thanks to Kenneth Porter for the bug report. @@ -248,7 +265,7 @@ 2. Made restore to chdir() back into the initial directory when dumping core while aborting a comparision operation. The previous behaviour was to write the corefile at the root of - the directory being compared, which could very well be + the directory being compared, which could very well be read only and preventing the corefile generation. Thanks to Kenneth Porter for the bug report. @@ -278,13 +295,13 @@ dump containing files over 2GB. Thanks to Steve Bonds for the bug report. -4. Do not save directory entries to non-dumped inodes +4. Do not save directory entries to non-dumped inodes (excluded from dump). This will eliminate the 'missing file' warnings when doing 'restore -C'. 5. Fix dump crash when backuping a huge (2TB) filesystem, due to a bogus calculation on the inode map size. - Thanks to Kevin B. Haines for + Thanks to Kevin B. Haines for submitting the bug and testing the fix. 6. Fix a problem in restore where the final \0 in the symbolic @@ -302,7 +319,7 @@ attributes into the comparision. 9. Made restore understand tapes containing EA/ACLs (which will - be dumped by the next version of dump). In this version + be dumped by the next version of dump). In this version extended attributes on the tape are ignored, for full EA/ACL support wait for the next version or try the experimental EA patch. @@ -315,20 +332,20 @@ libz and libbz2 (and dynamic versions of all other libraries). This will make Debian users happy, because libz and libbz2 were the only needed libraries living in /usr, all the - others live in /lib. In case of system emergency, it is + others live in /lib. In case of system emergency, it is better not to have to rely on an extra filesystem. Thanks to Bdale Garbee for the suggestion. 2. Fix compilation on (at least the Linux Debian port to) AMD64. ( defines some types (__s64 and __u64) - that are also defined by () and + that are also defined by () and they conflict). 3. Make dump's reading of the dumpdates file a bit more robust, preventing dump from crashing when the dumpdates file has been modified by hand. -4. Fixed some offset calculations in dump code which could +4. Fixed some offset calculations in dump code which could lead to "bread lseek errors" on large filesystems. Thanks to Bruce Lowekamp for reporting this bug and debugging the issue. @@ -337,7 +354,7 @@ by label or uuid instead of dump's own routines. 6. Corrected a bug in dump where a wrong LABEL=... line in - /etc/fstab could prevent dump from dumping unrelated + /etc/fstab could prevent dump from dumping unrelated filesystems. Thanks to Bruce Lowekamp for reporting the bug. @@ -352,7 +369,7 @@ 3. Fixed a bug in restore preventing the read of a dump tape written with Solaris 7 ufsdump. Thanks to Patrick Higgins - for reporting the bug and providing + for reporting the bug and providing the test case. 4. Changed dump to enable the creation of volumes of different @@ -376,8 +393,8 @@ feature even when it is combined with -M/-f. 9. Fixed restore when restoring huge backups (where rstdir... - temporary files are over 2GB). Thanks to - Raphael Jaffey for reporting this, + temporary files are over 2GB). Thanks to + Raphael Jaffey for reporting this, debugging the issue and making the patch. 10. Made restore understand FreeBSD UFS2 tapes. Thanks to @@ -387,7 +404,7 @@ 11. Made dump work with an arbitrary integer level (no more 10 levels only limitation). Thanks to Matthew for the patch. - + Changes between versions 0.4b34 and 0.4b35 (released December 21, 2003) ======================================================================= @@ -401,12 +418,12 @@ for reporting the bug. 3. Made -e/-E options of dump accept an unlimited number of inodes - to be excluded, rather than a hardcoded maximum. Thanks to + to be excluded, rather than a hardcoded maximum. Thanks to Dietrich Rothe for the patch. 4. Updated the autoconf system to 2.50. Forced the -D_BSD_SOURCE and -D_USE_BSD_SIGNAL defines in configure in order to solve - 64bit build problems because quad_t is redifined with a + 64bit build problems because quad_t is redifined with a different signature. Thanks to Mike Harris for reporting this bug. @@ -421,7 +438,7 @@ used in the future to save ACLs... 7. Made rmt work correctly with regard to QFA and local/remote - files and tapes. The remote access will however work only + files and tapes. The remote access will however work only when the dump provided rmt version is used. If you want to use another rmt server, please do not use the QFA feature. Thanks to Uwe Gohlke for the patch. @@ -435,7 +452,7 @@ 2. Fixed the configure script to only check for headers presence instead of trying to compile them. This should fix issues - with old build environments. Thanks to Kari Lempiainen + with old build environments. Thanks to Kari Lempiainen for reporting the bug. 3. Fixed restore to correctly ignore sockets when comparing @@ -443,7 +460,7 @@ to Gunther Reiszig for reporting the bug. 4. Fixed restore to correctly access the archive file (-A argument) - even when using a remote tape. Thanks to Fabrice Bellet + even when using a remote tape. Thanks to Fabrice Bellet for reporting the bug. 5. Fixed (again) handling of long (largefile) seeks in rmt. @@ -454,12 +471,12 @@ dump is able to write now (-b 1024). Thanks to Fabrice Bellet for reporting the bug. -7. Fixed a bug preventing dump to access a filesystem having +7. Fixed a bug preventing dump to access a filesystem having a label exactly 16 bytes in length. Thanks to for reporting the bug. 8. Made dump store dump dates using explicit timezones, fixing a - problem with incremental dumps if the timezone is modified + problem with incremental dumps if the timezone is modified between the dumps. Thanks to Philippe Troin for the bug report and the patch. @@ -471,7 +488,7 @@ bug and providing the fix. 10. Fixed open and creation modes and permissions for QFA and - table-of-contents files in dump and restore. Thanks to + table-of-contents files in dump and restore. Thanks to Philippe Troin for the patch. 11. Fixed the archive file descriptor handling enabling it to be 0. @@ -479,16 +496,16 @@ Thanks to Philippe Troin for the patch. 12. Delayed the opening of archive file until after suid had been - dropped (fixing a possible security issue if dump is suid). + dropped (fixing a possible security issue if dump is suid). Thanks to Philippe Troin for the patch. 13. Fixed the 'S' command handling in the rmt client part. Thanks to Philippe Troin for the patch. - + 14. Modified the end-of-tape script handling to print out statistics (and stop the timer) before launching the eot script. Also, the eot script does not get run anymore when using -M (which makes sense) or - when multiple tapes are listed on the command line + when multiple tapes are listed on the command line (-f tape0,tape1,tapen) (which also makes sense). Thanks to Philippe Troin for the patch. @@ -497,8 +514,8 @@ 16. Added LZO compression to dump. This new compression method has the advantage of being super fast, thus not killing tape streaming - on slow machines. Thanks to Helmut Jarausch - for the patch and to + on slow machines. Thanks to Helmut Jarausch + for the patch and to Markus Oberhumer for giving special permission to include his miniLZO project (GPL licensed) in dump/restore. @@ -515,7 +532,7 @@ 20. Fixed a bug which caused dump -w|-W not to work anymore, because the fs_freq and fs_passno fields in /etc/mtab are always set - to 0 0. Thanks to Trent Piepho for + to 0 0. Thanks to Trent Piepho for reporting the bug. Changes between versions 0.4b32 and 0.4b33 (released February 10, 2003) @@ -533,7 +550,7 @@ an extra, unrelated error message). Thanks to Dragan Krnic for reporting this bug. -4. Made dump look first into /etc/mtab, then into /etc/fstab +4. Made dump look first into /etc/mtab, then into /etc/fstab when searching for filesystem paths. Also fixed some problems caused by binding mounts or multiple block device mounts. Thanks to Matus Uhlar , Elliott Mitchell @@ -548,7 +565,7 @@ 6. Fixed the output of dump to indicate 'blocks' instead of 'tape blocks' in the various messages (blocks are always - 1 Kilobyte, tape blocks are 1 BK * '-b' argument), and + 1 Kilobyte, tape blocks are 1 BK * '-b' argument), and made it clearly print the current blocksize at the start of a dump. Thanks to Michal Szymanski for the suggestions. @@ -571,17 +588,17 @@ ======================================================================= 1. Changed dump to use fcntl(F_SETLK) style locking instead - of flock() when locking the dumpdates file. With the old - locking scheme, a local user having read rights on the + of flock() when locking the dumpdates file. With the old + locking scheme, a local user having read rights on the dumpdates file could be able to do a Denial of Service attack on dump. In order to lock the dumpdates file with the new scheme, the user would need to have write access on the file. - Thanks to Richard Johnson for + Thanks to Richard Johnson for reporting the bug (originally a bugtraq post). 2. Fixed interactive 'ls' which caused spurious errors warnings - about 'undefined filetypes' detected. Thanks to Jorgen Ostling - for reporting this + about 'undefined filetypes' detected. Thanks to Jorgen Ostling + for reporting this bug. 3. Fixed dump's estimate when dealing with sparse inodes. @@ -593,7 +610,7 @@ 5. Fixed a bug causing Dump to stop and report an error if an inode number in the exclude file was followed by some amount - of whitespace. Thanks to Jeffrey Sofferin + of whitespace. Thanks to Jeffrey Sofferin for reporting this bug. 6. Fixed a bug which caused restore, in some particular cases, @@ -619,7 +636,7 @@ 1. Made dump print out the ext2 logical block number in case of a read error, which can be given as an argument to debugfs' ncheck command, - in order to find out the affected inode. Added note about this + in order to find out the affected inode. Added note about this usage in dump's man page. 2. Fixed a problem in restore when reading tapes written on big @@ -627,7 +644,7 @@ contributed by George Helffrich . 3. Fixed the tape length calculation when using large tapes - and compression. Thanks to Georg Lippold + and compression. Thanks to Georg Lippold for reporting the bug. 4. Added a new set of examples in dump_on_cd_2 directory, based @@ -636,15 +653,15 @@ Georg Lippold for the new scripts. 5. Made dump save 32 bit UID/GID. Internally, this was achieved - by switching from the old BSD inode format to the new BSD + by switching from the old BSD inode format to the new BSD inode format, which means that the tape format was changed. - However, since all restore versions out there should + However, since all restore versions out there should transparently support both inode formats, the change should have no side effects. Thanks to John Yu for reporting the bug. 6. Fixed a lot of warnings in the code shown when compiling - with 'gcc -W'. Thanks to Matthias Andree + with 'gcc -W'. Thanks to Matthias Andree for reporting this. 7. Fixed a small markup bug in the dump man page. Thanks to @@ -671,19 +688,19 @@ contained on the first volume (when using really small volumes or when dumping a huge number of inodes). -3. Fixed a problem in dump, where files in subdirectories of directories - that have the nodump flag set (or being excluded with -e/-E) were +3. Fixed a problem in dump, where files in subdirectories of directories + that have the nodump flag set (or being excluded with -e/-E) were sometimes incorrectly dumped (instead of being excluded). The original - fix is from David C Lawrence in the FreeBSD version + fix is from David C Lawrence in the FreeBSD version of dump: http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32414 - Thanks to Ted Grzesik for reporting the bug and + Thanks to Ted Grzesik for reporting the bug and help testing the patch. 4. Added some example scripts from Gerd Bavendiek which makes one able to pipe the output of dump, by the net, to a remote CD-burner server. -5. Made dump use O_CREAT|O_TRUNC both locally and remotely (over rmt), +5. Made dump use O_CREAT|O_TRUNC both locally and remotely (over rmt), and use GNU's symbolic syntax over rmt instead of numerical values to assure multiple platform compatibility. @@ -701,7 +718,7 @@ Changes between versions 0.4b27 and 0.4b28 (released April 12, 2002) ==================================================================== -1. Fixed a bug in the QFA feature which could have caused +1. Fixed a bug in the QFA feature which could have caused a bad tape positionning on restore (causing extra delays in restore). Credits go to Uwe Gohlke . @@ -730,7 +747,7 @@ open the output file for writing. Thanks to Amith Varghese for reporting this bug. -7. Made restore able to understand large Solaris ufsdump tapes +7. Made restore able to understand large Solaris ufsdump tapes (containing inodes bigger than 4194304). Sun have introduced an "extension" to the dump tape format when dealing with those inodes, which was uncorrectly handled by Linux restore. @@ -741,7 +758,7 @@ inodes having been changed but not modified since the last dump ('changed' and 'modified' have the meaning defined in stat(2)). For those inodes, dump will save only the metadata, instead of - saving the entire inode contents. Inodes which are either + saving the entire inode contents. Inodes which are either directories or have been modified since the last dump are saved in a regular way. Uses of this flag must be consistent, meaning that either every dump in an incremental dump set have the flag, @@ -753,7 +770,7 @@ 1. Fixed behaviour of dump when exceeding resource limits (SIGXFSZ treatment). -2. Added the -L flag to restore to allow the user to specify a +2. Added the -L flag to restore to allow the user to specify a maximal allowed number of miscompares when using restore with the -C option to check the backup. @@ -765,11 +782,11 @@ 5. Extended the QFA mode to work with local files and/or remote tapes and files. This way, restore can know in advance - the tape number and the offset for the inodes to extract and - can minimize the extraction time by seeking directly to the + the tape number and the offset for the inodes to extract and + can minimize the extraction time by seeking directly to the good tape/offset. -6. Added the -A option to both dump and restore, +6. Added the -A option to both dump and restore, which makes dump to archive a dump table-of-contents in the specified file to be used by restore to determine whether a file is in the dump file that is being restored. @@ -784,10 +801,10 @@ for reporting this bug. 9. Added the -P option to restore to create a - Quick File Access file from an already made dump. Patch + Quick File Access file from an already made dump. Patch contributed by Uwe Gohlke . -10. Made restore compile and run on Solaris, making it a +10. Made restore compile and run on Solaris, making it a possible replacement for the standard ufsrestore. Port was contributed by Uwe Gohlke . @@ -800,7 +817,7 @@ several filesystems on a separate filesystem. 2. Fixed a off-by-one miscalculation which disabled dumping - a one letter subdirectory. Thanks to Chris Siebenmann + a one letter subdirectory. Thanks to Chris Siebenmann for reporting the bug. 3. Fixed several restore bugs occuring when trying to @@ -815,11 +832,11 @@ number inode of a filesystem, to not be dumped. Many thanks to Chris Siebenmann for helping me chase this bug. - + Changes between versions 0.4b24 and 0.4b25 (released November 17, 2001) ======================================================================= -1. Added a mini howto from Patrick Walsh in the examples +1. Added a mini howto from Patrick Walsh in the examples directory. 2. Minor man pages syntax corrections. Thanks to @@ -840,14 +857,14 @@ 6. Add the -l option to restore to specify if, when doing a remote restore, the file used to access the backup is a regular file (the defaults being a tape drive). Restore needs - to know this information when reading a remote compressed + to know this information when reading a remote compressed dump. Previously, this information was autodetected, but - the autodetection code fails (with ioctl: Inappropriate ioctl - for device) when using a non Linux remote box. Thanks to - many users and especially to Eros Albertazzi + the autodetection code fails (with ioctl: Inappropriate ioctl + for device) when using a non Linux remote box. Thanks to + many users and especially to Eros Albertazzi for reporting this. -7. Found a workaroung for the dump deadlock problem (3 childs +7. Found a workaroung for the dump deadlock problem (3 childs stuck in pause(), father in read()). The workaround seems to work for me and several beta-testers. If it doesn't work for you, please report back. @@ -859,7 +876,7 @@ 1. Fixed the permissions of a newly created QFA file by dump. -2. Cleaned up the source of dump (the external variables +2. Cleaned up the source of dump (the external variables definition was a complete mess, making possible to have objects overlap). @@ -867,14 +884,14 @@ a compare (since it changes the working directory to the filesystem being compared in the process). -4. Added the -q option to dump which makes dump abort +4. Added the -q option to dump which makes dump abort whenever it needs operator attention. It should be easier to use dump in scripts with this option. 5. Detect the use of incompatible options to dump and refuse them (like -a and -B options together). -6. Added bzip2 compression to dump/restore (use option -j level +6. Added bzip2 compression to dump/restore (use option -j level to select it). Note that you will need a restore version >= 0.4b24 in order to restore a bzip2 compressed dump. The same warning as for the zlib compression applies: @@ -882,7 +899,7 @@ original BSD tape format. 7. Fixed a overflow problem in dump corrupting the dump when - very large files were encountered. Thanks to Vladimir Nadvornik + very large files were encountered. Thanks to Vladimir Nadvornik for the bug report. 8. Added a ioctl(BLKFLSBUF) in dump which should flush the @@ -891,13 +908,13 @@ John Yu and to Theodore T'so for this suggestion. -9. Updated the RPM spec file following the RedHat changes +9. Updated the RPM spec file following the RedHat changes (dynamically linked binaries now in /usr/sbin etc). 10. Added a patch from Helmut Jarausch which enables restore to recognise multi volume compressed dumps done on CD. Included his scripts for dump (which pipe the dump - output directly into cdrecord) and restore. There is now + output directly into cdrecord) and restore. There is now possible to to backups to CD on the fly! Changes between versions 0.4b22 and 0.4b23 (released July 20, 2001) @@ -909,21 +926,21 @@ 2. Implement the Sun rmt extended protocol. Patch submitted by Ian Gordon . -3. Check for the e2fsprogs header instead of +3. Check for the e2fsprogs header instead of the linux kernel header. This ensures that dump always has the latest version of this file. Patch submitted by Andreas Dilger . -4. Report any filesystem present in either /etc/fstab with a +4. Report any filesystem present in either /etc/fstab with a positive passno or /etc/dumpdates in dump -w output. Patch submitted by Andreas Dilger . -5. Fixed the looping problem in dump introduced in the +5. Fixed the looping problem in dump introduced in the previous version. -6. Changed the -B option of dump to limit the size of +6. Changed the -B option of dump to limit the size of _compressed_ output per volume if compression is on. - Patch contributed by Helmut Jarausch + Patch contributed by Helmut Jarausch . Note however that, since it is impossible to predict the size of the compressed data before doing the compression, the -B limit is a bit @@ -938,7 +955,7 @@ tape changers for example. See the restore man page for the script parameters and return codes. -9. Small fix for the QFA routines provided by Uwe Gohlke +9. Small fix for the QFA routines provided by Uwe Gohlke , and some recommendations for QFA uses in the man pages. @@ -968,14 +985,14 @@ 3. Added a compression option to dump, contributed by Jerry Peters . - WARNING: the compression works only on files/pipes and + WARNING: the compression works only on files/pipes and drives supporting variable block size. WARNING2: tapes created using the compression feature are incompatible with the standard dump tape format, and a version of restore >= 0.4b22 will be needed for extraction. -4. Fixed some compilation problems for glibc 2.2.2 and 64 bit +4. Fixed some compilation problems for glibc 2.2.2 and 64 bit architectures. Thanks to Paul Slootman for the patch and to Bdale Garbee for forwarding it upstream. @@ -989,19 +1006,19 @@ 7. Added the Quick File Access mode in dump/restore, contributed by Uwe Gohlke . In this mode, dump stores in - a file tape position for each inode, and this file is used by + a file tape position for each inode, and this file is used by restore (if called with parameter Q and the filename) - to directly position the tape at the file restore is currently + to directly position the tape at the file restore is currently working on. This saves hours when restoring single files from large backups, saves the tapes and the drive's head. Use --enable-qfa option of configure to compile in the QFA support. 8. Added the possibility to dump several files and directories - in a single invocation of dump. Thanks to Uwe Gohlke + in a single invocation of dump. Thanks to Uwe Gohlke for implementing this option. 9. Fixed the dumping and restoring of files with holes - (files ending with holes didn't get dumped or restored + (files ending with holes didn't get dumped or restored correctly). 10. Fixed a socket descriptor leak in dump, which leaved opened @@ -1009,34 +1026,34 @@ process per tape). 11. Fixed dump large file system support, by explicit use of - open64/lseek64/etc functions (explicit use needed because - e2fsprogs libraries don't behave well when compiled with + open64/lseek64/etc functions (explicit use needed because + e2fsprogs libraries don't behave well when compiled with FILE_OFFSET_BITS=64). Changes between versions 0.4b20 and 0.4b21 (released January 13, 2001) ====================================================================== 1. Fixed some bugs in the dump -w|-W logic introduced by - the previous version. Thanks to Andreas Dilger + the previous version. Thanks to Andreas Dilger for his help on this one. 2. Fixed again a compilation problem when using old e2fs headers (filesystem label related). Thanks to many users who reported this stupid error. -3. Fixed a build problem on old lib5 based systems dealing with +3. Fixed a build problem on old lib5 based systems dealing with _PATH_MNTTAB being undefined. Thanks to John Adams for reporting the bug. 4. Improved the error detection in restore when creating the temporary files in TMPDIR. Now restore will corectly - report a 'no space left on device' error instead of + report a 'no space left on device' error instead of strange errors which could imply an archive corruption. Thanks to Gabriel Somlo and bgjenero for reporting the bug. 5. Added the throughput information in dump's progression - messages. Thanks to Andreas Dilger + messages. Thanks to Andreas Dilger for the patch. 6. Use libext2fs's inode scanning routines, which are particularly @@ -1067,20 +1084,20 @@ 1. Fixed a small compilation problem due to a change in the definintion of the struct sigaction in - glibc 2.0 / libc5. Thanks to Gunther Schlegel + glibc 2.0 / libc5. Thanks to Gunther Schlegel for reporting the bug and to Dave Platt for suggesting a fix. -2. Modified the label and uuid analysis in order to be - self-contained (independant of kernel/libc headers). This +2. Modified the label and uuid analysis in order to be + self-contained (independant of kernel/libc headers). This should fix the compile with older kernel/libc headers and will preserve the functionality. Thanks to Bernhard Erdmann for reporting the bug. 3. The 'exclude inode' option, if applied to a directory - inode, excludes now correctly all the leaves of this - directory. Thanks to John R. Dennison + inode, excludes now correctly all the leaves of this + directory. Thanks to John R. Dennison for reporting the bug. 4. Fixed the '-e' option to disable the possibility @@ -1089,8 +1106,8 @@ when multiple -e options are used. 5. Fixed dump to correctly interpret a filesystem argument - which is a mountpoint and it is not an absolute path - (as specified in the fstab). Thanks to Bernhard R. Erdmann + which is a mountpoint and it is not an absolute path + (as specified in the fstab). Thanks to Bernhard R. Erdmann for reporting the bug. 6. Made dump able to backup files larger than 2 GB. Note that @@ -1103,7 +1120,7 @@ of fstab file from the system headers. Thanks to Andreas Dilger for the patch. -9. Made dump -w|-W report all recognized filesystems +9. Made dump -w|-W report all recognized filesystems present in either /etc/fstab or /etc/dumpdates, and present the list in the same order as in fstab file. Thanks to Andreas Dilger for the patch. @@ -1123,13 +1140,13 @@ 1. Fixed the signal handling in dump (which I broke in 0.4b17) which was causing several strange dump failures (dump - hanged or segmentation faults etc). + hanged or segmentation faults etc). 2. Specified the default blocksize in the dump man page. 3. Changed two info messages of restore to be written on stdout instead of stderr in order to leave stderr only for errors - or warnings. Thanks to Stephen Atwell + or warnings. Thanks to Stephen Atwell for the suggestion. 4. Corrected an off by one calculation which prevented @@ -1138,8 +1155,8 @@ for reporting the bug. 5. Reinforce dump in order to allow only level 0 and no - -u option when dumping a subdirectory, and document - this in the man page. Thanks to Bernhard Erdmann + -u option when dumping a subdirectory, and document + this in the man page. Thanks to Bernhard Erdmann for reporting the bug. 6. Fixed a small harmless bug in restore which caused @@ -1159,14 +1176,14 @@ 9. Made dump understand the LABEL= and UUID= notation both in /etc/fstab and on the command line. Note that you will need the /proc filesystem in order to use - these notations. Thanks to Erik Troan + these notations. Thanks to Erik Troan for providing the patch. Changes between versions 0.4b17 and 0.4b18 (released June 30, 2000) =================================================================== 1. Fixed a potential buffer overflow in restore. Thanks - to Stan Bubrouski for reporting + to Stan Bubrouski for reporting the bug. 2. Fixed a readline-related bug which prevented @@ -1189,7 +1206,7 @@ 5. Added -ltermcap to the compile parameters for restore when using readline support, in order to make the compile - process work on some systems (SuSE ?). Thanks to + process work on some systems (SuSE ?). Thanks to Patrik Schindler for reporting the bug. Changes between versions 0.4b16 and 0.4b17 (released June 1st, 2000) @@ -1205,7 +1222,7 @@ passed on the command line), you can enable it in configure with the --enable-oldstylefscript. -2. Use posix signal handling to preserve dump functionality +2. Use posix signal handling to preserve dump functionality with libc5. Thanks to Jeff Johnson for the patch. @@ -1217,8 +1234,8 @@ 4. Made (finally) quotes work in interactive restore. -5. Small fixes in order to allow dump to compile with a - really old e2fsprogs version. Thanks to Ian Zimmerman +5. Small fixes in order to allow dump to compile with a + really old e2fsprogs version. Thanks to Ian Zimmerman for the bug report. 6. Add GNU readline capabilities to interactive restore. @@ -1227,7 +1244,7 @@ suggestion. 7. Do the compare on the fly in restore 'C' mode (this will - allow not to exhaust the available /tmp space when + allow not to exhaust the available /tmp space when ccmparing large files). Thanks to Kenneth Porter for the suggestion. @@ -1249,16 +1266,16 @@ for the patch. 4. Added the -X option to restore giving the possibility - to read the names of the files to be extracted/listed - from a text file (in addition of the command line). - Thanks to Dejan Muhamedagic for the + to read the names of the files to be extracted/listed + from a text file (in addition of the command line). + Thanks to Dejan Muhamedagic for the patch. 5. Added the device name and the current volume number as arguments to the end of tape script (dump -F option). -6. Made the multi-volume dump work again (after having - broken it in 0.4b15). +6. Made the multi-volume dump work again (after having + broken it in 0.4b15). Changes between versions 0.4b14 and 0.4b15 (released March 2, 2000) =================================================================== @@ -1266,18 +1283,18 @@ 1. Added a prompt command in interactive restore mode. Thanks to Andreas Dilger for the patch. -2. Fixed a buffer overflow problem in dump (caused by - not checking the size of the filesystem parameter). +2. Fixed a buffer overflow problem in dump (caused by + not checking the size of the filesystem parameter). Thanks to Kim Yong-jun for reporting this on Bugtraq (and to several dump users who forwarded me his mail). -3. Added the '-F script' option to dump in order to +3. Added the '-F script' option to dump in order to launch a script at the end of each tape (to be used with a tape changer, or to notify the sysadmin by pager etc.). -4. Fixed a bug in restore compare code caused by the changes +4. Fixed a bug in restore compare code caused by the changes I made in 0.4b14. 5. Fixed the treatment of options using the old BSD syntax @@ -1286,7 +1303,7 @@ Changes between versions 0.4b13 and 0.4b14 (released February 10, 2000) ======================================================================= -1. Fixed a bug in dump which may have caused invalid deleted +1. Fixed a bug in dump which may have caused invalid deleted directories to be dumped out if they were deleted after the mapping pass. This could occure on active filesystem and lead to heap corruption (causing dump malfunction in many possible ways). @@ -1312,19 +1329,19 @@ Ambrose Li for submitting the patch. 7. Fixed a compatibility problem between dumps made on little - endian machines (the format was correct) and big endian + endian machines (the format was correct) and big endian machines (the format was incorrect). This fix break the - compatibility with the older dumps made on big endian + compatibility with the older dumps made on big endian machines (sparc, m86k, ppc etc). For the first time in - linux dump's history (I believe), the dumps made by *BSD, - Linux/alpha, Linux/sparc and Linux/x86 are compatible, + linux dump's history (I believe), the dumps made by *BSD, + Linux/alpha, Linux/sparc and Linux/x86 are compatible, so interchangeable. Thanks to Rob Cermak for submitting the bug and helping me test the fix. 8. Fixed the way dump reports the remaining percent/time, if the number of blocks actually dumped exceeds the estimated - number of blocks. Thanks to Jean-Paul van der Jagt + number of blocks. Thanks to Jean-Paul van der Jagt for reporting the bug. Changes between versions 0.4b12 and 0.4b13 (released January 21, 2000) @@ -1334,12 +1351,12 @@ for reporting the bug. 2. Removed the requirement to build the RPM as root from the - spec file. Thanks to Christian Weisgerber + spec file. Thanks to Christian Weisgerber for submitting this. 3. Fixed a bug in dump related to the 'filetype' feature of ext2fs, causing dump to block when dumping really huge filesystems. - Many thanks to Patrik Schindler for + Many thanks to Patrik Schindler for helping me find this bug. 4. Fixed the treatment for an interrupt signal when dump access @@ -1352,7 +1369,7 @@ Changes between versions 0.4b11 and 0.4b12 (released January 8, 2000) ===================================================================== -1. Small fix in the dump man page. Thanks to Thorsten Kukuk +1. Small fix in the dump man page. Thanks to Thorsten Kukuk for submitting the patch. 2. Fix for the exit code when using the size estimate option of @@ -1369,20 +1386,20 @@ 5. Fixed a bug in dump which prevented the creation of the dumpdates file when doing a 0-level dump without already - having a dumpdates file. Thanks to Patrik Schindler + having a dumpdates file. Thanks to Patrik Schindler for reporting the bug. 6. Changed the way dump 'S' flag reports the size estimate from number of blocks into bytes (making it compatible with the Solaris version, and simplifying things for - amanda users). Thanks to Jason L Tibbitts III + amanda users). Thanks to Jason L Tibbitts III for reporting the bug. 7. Fixed a compatibility problem in linux/alpha dump tape format. Now the linux/alpha dump are (again) compatible with the other dump formats. But this breaks compatibility with - older dumps made on alpha. Thanks to Mike Tibor - for helping me in finding this bug. + older dumps made on alpha. Thanks to Mike Tibor + for helping me in finding this bug. Changes between versions 0.4b10 and 0.4b11 (released December 5, 1999) ====================================================================== @@ -1403,21 +1420,21 @@ asking to enter a new tape each time. 4. Fixed a memory leak which was causing dump to grow very big - (270MB when dumping a 10GB filesystem...). Thanks to Jason + (270MB when dumping a 10GB filesystem...). Thanks to Jason Fearon for reporting the bug. Changes between versions 0.4b9 and 0.4b10 (released November 21, 1999) ====================================================================== -1. Make configure test if the system glob routines support +1. Make configure test if the system glob routines support extended syntax (ALTDIRFUNC). If not, use the internal glob - routines instead of system ones. Thanks to Bernhard Sadlowski + routines instead of system ones. Thanks to Bernhard Sadlowski for reporting the bug and helping me resolve this and other minor libc5 compiling glitches. 2. Fix a problem when dumping a ext2fs with the 'filetype' - feature enabled. Thanks to Patrick J. LoPresti + feature enabled. Thanks to Patrick J. LoPresti for reporting the bug and to Theodore Y. Ts'o for providing the patch. @@ -1430,7 +1447,7 @@ is a "quick and dirty" patch which enables backup of an ext3 filesystem through the ext2 compatibility (by ignoring the NEEDS_RECOVERY bit). The journal file is not recognized and - it is dumped (it should not). + it is dumped (it should not). 5. Test the superblock compatibility flags when dumping, in order to be sure that we know how to deal with specific features. @@ -1438,7 +1455,7 @@ Changes between versions 0.4b8 and 0.4b9 (released November 5, 1999) ==================================================================== -1. Use lchown instead of chown, fixing a possible security problem +1. Use lchown instead of chown, fixing a possible security problem when restoring symlinks (a malicious user could use this to deliberately corrupt the ownership of important system files). Thanks to Chris Siebenmann for detecting @@ -1502,18 +1519,18 @@ 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 +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 + 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 + the location of dumpdates file. By default, it is /etc/dumpdates. -10. Added the "AUTHOR" and "AVAILABILITY" sections and +10. Added the "AUTHOR" and "AVAILABILITY" sections and included the current date/version in man pages. 11. Corrected the estimation of remaining time when @@ -1527,7 +1544,7 @@ 1. Integrated multiple patches from RedHat, Debian and SuSE: - - tweak dump/itime.c to not try to read dumpdates if the 'u' option + - tweak dump/itime.c to not try to read dumpdates if the 'u' option isn't specified. - several fixes in the man pages. - update the default tape device to /dev/st0. diff -Nru dump-0.4b45/REPORTING-BUGS dump-0.4b46/REPORTING-BUGS --- dump-0.4b45/REPORTING-BUGS 2016-04-21 14:23:24.000000000 +0000 +++ dump-0.4b46/REPORTING-BUGS 2016-06-08 05:01:45.000000000 +0000 @@ -7,7 +7,7 @@ 1. Are you sure it's a bug? If you just are not sure about how to use a specific feature of dump, please post your question on the dump-users mailing list. While you are there, try to browse the -archives of the mailing list and see if someone asked the same question +archives of the mailing list and see if someone asked the same question before. NOTE: questions about how to use the d(ensity) (b)locksize parameters @@ -16,7 +16,7 @@ 2. Always test the last version of dump/restore before submitting a bug report. Your problem is maybe already fixed! -3. Consult the bugs using the bug system at sourceforge. Use this +3. Consult the bugs using the bug system at sourceforge. Use this bug system if you want to report a new bug or contribute to an existing bug. You may want to create an account on sourceforge for that, so the comments will automatically be forwarded to your email address. @@ -38,13 +38,13 @@ - anything else you believe will help me to find the bug... 6. In addition, if you want to report a bug on dump, provide also: - - details of your filesystem you want to dump: - output of the command 'tune2fs -l /dev/sda1' + - details of your filesystem you want to dump: + output of the command 'tune2fs -l /dev/sda1' (replace sda1 with your partition...) - if your filesystem was mounted when doing the dump, try to rerun the command with the filesystem unmounted. Does the bug still occur? - - try to dump your filesystem using /dev/null as tape device. + - try to dump your filesystem using /dev/null as tape device. This may help to know that the bug is not triggered by a buggy device or tape or remote access problems. diff -Nru dump-0.4b45/restore/interactive.c dump-0.4b46/restore/interactive.c --- dump-0.4b45/restore/interactive.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/restore/interactive.c 2016-06-08 05:01:45.000000000 +0000 @@ -377,9 +377,9 @@ #else do { if (pflag) - fprintf(stderr, "%s:%s:%s > ", + fprintf(stderr, "%s:%s:%s > ", __progname, - spcl.c_filesys, + spcl.c_filesys, curdir[1] ? &curdir[1] : "/"); else fprintf(stderr, "%s > ", __progname); @@ -512,7 +512,7 @@ (void) strcpy(canonname, "./"); if (strlen(canonname) + strlen(rawname) >= (unsigned)len) errx(1, "canonname: not enough buffer space"); - + (void) strcat(canonname, rawname); /* * Eliminate multiple and trailing '/'s @@ -775,7 +775,7 @@ 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) @@ -845,9 +845,9 @@ static char completion_curdir[MAXPATHLEN]; -static char *commands[] = { - "add ", "cd ", "delete ", "extract ", "help ", - "? ", "ls ", "pwd ", "prompt ", "quit ", "xit ", +static char *commands[] = { + "add ", "cd ", "delete ", "extract ", "help ", + "? ", "ls ", "pwd ", "prompt ", "quit ", "xit ", "verbose ", "setmodes ", "what ", "Debug ", NULL }; @@ -867,9 +867,9 @@ prompt = (char *)malloc(sz); if (!prompt) return NULL; - snprintf(prompt, sz, "%s:%s:%s > ", + snprintf(prompt, sz, "%s:%s:%s > ", __progname, - spcl.c_filesys, + spcl.c_filesys, (completion_curdir + 1 ? completion_curdir + 1 : "/")); } else { @@ -1022,8 +1022,8 @@ return (matches); } -static void -initialize_readline(void) +static void +initialize_readline(void) { rl_readline_name = "dump"; rl_attempted_completion_function = restore_completion; diff -Nru dump-0.4b45/restore/main.c dump-0.4b46/restore/main.c --- dump-0.4b45/restore/main.c 2016-05-09 04:52:32.000000000 +0000 +++ dump-0.4b46/restore/main.c 2016-07-04 02:53:53.000000000 +0000 @@ -111,7 +111,7 @@ #ifdef USE_QFA FILE *gTapeposfp; -char *gTapeposfile; +const char *gTapeposfile; char gTps[255]; long gSeekstart; int tapeposflag; @@ -177,9 +177,9 @@ if ((tmpdir = strdup(tmpdir)) == NULL) err(1, "malloc tmpdir"); for (p = tmpdir + strlen(tmpdir) - 1; p >= tmpdir && *p == '/'; p--) - ; + ; obsolete(&argc, &argv); - while ((ch = getopt(argc, argv, + while ((ch = getopt(argc, argv, "aA:b:CcdD:" #ifdef TRANSSELINUX /*GAN6May06 SELinux MLS */ "eE:" @@ -353,7 +353,7 @@ if (tapeposflag && command != 'i' && command != 'x' && command != 't') errx(1, "Q option is not valid for %c command", command); #endif - + if (Afile && command != 'i' && command != 'x' && command != 't') errx(1, "A option is not valid for %c command", command); @@ -537,7 +537,7 @@ checkrestore(); dumpsymtable(symtbl, (long)1); break; - + /* handle file names from either text file (-X) or the command line */ #define NEXTFILE(p) \ p = NULL; \ @@ -553,7 +553,7 @@ continue; \ } \ } - + /* * List contents of tape. */ @@ -608,7 +608,7 @@ #ifdef DEBUG_QFA tiend = time(NULL); titaken = tiend - tistart; - msg("restore took %d:%02d:%02d\n", titaken / 3600, + msg("restore took %d:%02d:%02d\n", titaken / 3600, (titaken % 3600) / 60, titaken % 60); #endif /* DEBUG_QFA */ break; @@ -668,7 +668,7 @@ #ifdef DEBUG_QFA tiend = time(NULL); titaken = tiend - tistart; - msg("writing QFA positions took %d:%02d:%02d\n", titaken / 3600, + msg("writing QFA positions took %d:%02d:%02d\n", titaken / 3600, (titaken % 3600) / 60, titaken % 60); #endif /* DEBUG_QFA */ break; @@ -690,7 +690,7 @@ #ifdef __linux__ ext2fs_get_library_version(&ext2ver, &ext2date); - (void)fprintf(stderr, "%s %s (using libext2fs %s of %s)\n", + (void)fprintf(stderr, "%s %s (using libext2fs %s of %s)\n", __progname, _DUMP_VERSION, ext2ver, ext2date); #else (void)fprintf(stderr, "%s %s\n", __progname, _DUMP_VERSION); @@ -733,14 +733,14 @@ "\t%s [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n" "\t%s -x [-acd" tseflag "hH" kerbflag "lmMouvVy] [-A file] [-b blocksize] " tsEflag"\n" "\t%s [-f file] [-F script] " qfaflag "[-s fileno] [-X filelist] [file ...]\n", - __progname, white, - __progname, white, + __progname, white, + __progname, white, #ifdef USE_QFA - __progname, white, + __progname, white, #endif __progname, white, - __progname, white, - __progname, white, + __progname, white, + __progname, white, __progname, white); exit(1); } diff -Nru dump-0.4b45/restore/Makefile.in dump-0.4b46/restore/Makefile.in --- dump-0.4b45/restore/Makefile.in 2016-05-09 06:36:02.000000000 +0000 +++ dump-0.4b46/restore/Makefile.in 2016-09-05 19:25:28.000000000 +0000 @@ -276,7 +276,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ -SSLLIB = @SSLLIB@ +SSL_CFLAGS = @SSL_CFLAGS@ +SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ diff -Nru dump-0.4b45/restore/restore.c dump-0.4b46/restore/restore.c --- dump-0.4b45/restore/restore.c 2016-05-09 05:08:47.000000000 +0000 +++ dump-0.4b46/restore/restore.c 2016-06-08 05:01:45.000000000 +0000 @@ -92,7 +92,7 @@ #ifdef USE_QFA if (tapeposflag) { /* add QFA positions to output */ (void)Inode2Tapepos(ino, &tnum, &tpos, 1); - fprintf(stdout, "%10lu\t%ld\t%lld\t%s\n", (unsigned long)ino, + fprintf(stdout, "%10lu\t%ld\t%lld\t%s\n", (unsigned long)ino, tnum, tpos, name); } else @@ -725,7 +725,7 @@ /* * If we find files on the tape that have no corresponding * directory entries, then we must have found a file that - * was created while the dump was in progress. Since we have + * was created while the dump was in progress. Since we have * no name for it, we discard it knowing that it will be * on the next incremental tape. */ @@ -759,8 +759,8 @@ /* * If we encounter the end of the tape and the next available * file is not the one which we expect then we have missed one - * or more files. Since we do not request files that were not - * on the tape, the lost files must have been due to a tape + * or more files. Since we do not request files that were not + * on the tape, the lost files must have been due to a tape * read error, or a file that was removed while the dump was * in progress. */ @@ -769,7 +769,7 @@ ep = lookupino(first); if (ep == NULL) panic("%d: bad first\n", first); - fprintf(stderr, "%s: (inode %lu) not found on tape\n", + fprintf(stderr, "%s: (inode %lu) not found on tape\n", myname(ep), (unsigned long)first); do_compare_error; ep->e_flags &= ~(NEW|EXTRACT); @@ -810,7 +810,7 @@ ep = lookupino(first); if (ep == NULL) panic("%d: bad first\n", first); - fprintf(stderr, "%s: (inode %lu) not found on tape\n", + fprintf(stderr, "%s: (inode %lu) not found on tape\n", myname(ep), (unsigned long)first); ep->e_flags &= ~(NEW|EXTRACT); first = lowerbnd(first); @@ -861,8 +861,8 @@ /* * If we encounter the end of the tape and the next available * file is not the one which we expect then we have missed one - * or more files. Since we do not request files that were not - * on the tape, the lost files must have been due to a tape + * or more files. Since we do not request files that were not + * on the tape, the lost files must have been due to a tape * read error, or a file that was removed while the dump was * in progress. */ @@ -871,7 +871,7 @@ ep = lookupino(first); if (ep == NULL) panic("%d: bad first\n", first); - fprintf(stderr, "%s: (inode %lu) not found on tape\n", + fprintf(stderr, "%s: (inode %lu) not found on tape\n", myname(ep), (unsigned long)first); do_compare_error; ep->e_flags &= ~(NEW|EXTRACT); @@ -937,7 +937,7 @@ ep = lookupino(next); if (ep == NULL) panic("corrupted symbol table\n"); - fprintf(stderr, "%s: (inode %lu) not found on tape\n", + fprintf(stderr, "%s: (inode %lu) not found on tape\n", myname(ep), (unsigned long)next); ep->e_flags &= ~NEW; next = lowerbnd(next); @@ -966,7 +966,7 @@ volChg = 0; } if (GetTapePos(&curtpos) == 0) { - /* curtpos +1000 ???, some drives + /* curtpos +1000 ???, some drives * might be too slow */ if (((tpos > (curtpos + 1000)) && (volChg == 0)) || ((tpos != curtpos) && (volChg == 1))) { volChg = 0; @@ -1023,8 +1023,8 @@ titaken = tiend - tistart; #ifdef DEBUG_QFA if (titaken / 60 > 0) - msg("%ld reads took %d:%02d:%02d\n", - tmpcnt, titaken / 3600, + msg("%ld reads took %d:%02d:%02d\n", + tmpcnt, titaken / 3600, (titaken % 3600) / 60, titaken % 60); #endif #endif /* USE_QFA */ @@ -1052,7 +1052,7 @@ #ifdef USE_QFA if (!createtapeposflag) #endif - fprintf(stderr, "%s: (inode %lu) not found on tape\n", + fprintf(stderr, "%s: (inode %lu) not found on tape\n", myname(ep), (unsigned long)next); ep->e_flags &= ~NEW; next = lowerbnd(next); diff -Nru dump-0.4b45/restore/restore.h dump-0.4b46/restore/restore.h --- dump-0.4b45/restore/restore.h 2016-05-09 04:52:27.000000000 +0000 +++ dump-0.4b46/restore/restore.h 2016-07-04 02:53:53.000000000 +0000 @@ -173,7 +173,7 @@ #define QFA_MAGIC "495115637697" #define QFA_VERSION "1.0" extern FILE *gTapeposfp; -extern char *gTapeposfile; +extern const char *gTapeposfile; extern char gTps[255]; extern long gSeekstart; extern int tapeposflag; diff -Nru dump-0.4b45/restore/symtab.c dump-0.4b46/restore/symtab.c --- dump-0.4b45/restore/symtab.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/restore/symtab.c 2016-06-08 05:01:45.000000000 +0000 @@ -105,13 +105,13 @@ { unsigned long hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9; int len = strlen(name); - + while (len--) { unsigned long hash = hash1 + (hash0 ^ (*name++ * 7152373)); if (hash & 0x80000000) hash -= 0x7fffffff; hash1 = hash0; - hash0 = hash; - } + hash0 = hash; + } return hash0 % dirhash_size; } @@ -352,7 +352,7 @@ if (ep->e_entries != NULL) { int i; for (i = 0; i < dirhash_size; i++) { - if (ep->e_entries[i] != NULL) + if (ep->e_entries[i] != NULL) badentry(ep, "freeing non-empty directory"); } } diff -Nru dump-0.4b45/restore/tape.c dump-0.4b46/restore/tape.c --- dump-0.4b45/restore/tape.c 2016-05-09 06:27:22.000000000 +0000 +++ dump-0.4b46/restore/tape.c 2016-09-05 19:24:52.000000000 +0000 @@ -337,9 +337,9 @@ readtape_func = readtape_set; #if defined(HAVE_LZO) if (lzo_init() != LZO_E_OK) { - msg("internal error - lzo_init failed \n"); - exit(1); - } + msg("internal error - lzo_init failed \n"); + exit(1); + } #endif #endif FLUSHTAPEBUF(); @@ -484,7 +484,7 @@ saved_blksread = blksread; saved_tpblksread = tpblksread; #if defined(USE_QFA) && defined(sunos) - if (createtapeposflag || tapeposflag) + if (createtapeposflag || tapeposflag) close(fdsmtc); #endif again: @@ -548,7 +548,7 @@ } closemt(); - /* + /* * if using an archive file, reset its name so readtape() * could properly use remote access. */ @@ -594,7 +594,7 @@ char *pos; (void) strncpy(magtape, buf, sizeof(magtape)); magtape[sizeof(magtape) - 1] = '\0'; - if ((pos = strchr(magtape, '\n'))) + if ((pos = strchr(magtape, '\n'))) magtape[pos - magtape] = '\0'; } } @@ -661,13 +661,13 @@ goto again; } tapesread |= 1 << volno; - /* - * If continuing from the previous volume, skip over any - * blocks read already at the end of the previous volume. - * - * If coming to this volume at random, skip to the beginning - * of the next record. - */ + /* + * If continuing from the previous volume, skip over any + * blocks read already at the end of the previous volume. + * + * If coming to this volume at random, skip to the beginning + * of the next record. + */ if (zflag) { fprintf(stderr, "Dump tape is compressed.\n"); #if !defined(HAVE_ZLIB) && !defined(HAVE_BZLIB) && !defined(HAVE_LZO) @@ -676,23 +676,23 @@ } Dprintf(stdout, "read %ld recs, tape starts with %ld\n", tpblksread - 1, (long)tmpbuf.c_firstrec); - if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) { - if (!wantnext) { - tpblksread = tmpbuf.c_firstrec + 1; - for (i = tmpbuf.c_count; i > 0; i--) - readtape(buf); - } else if (tmpbuf.c_firstrec > 0 && + if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) { + if (!wantnext) { + tpblksread = tmpbuf.c_firstrec + 1; + for (i = tmpbuf.c_count; i > 0; i--) + readtape(buf); + } else if (tmpbuf.c_firstrec > 0 && tmpbuf.c_firstrec < tpblksread - 1) { /* * -1 since we've read the volume header */ - i = tpblksread - tmpbuf.c_firstrec - 1; + i = tpblksread - tmpbuf.c_firstrec - 1; Dprintf(stderr, "Skipping %ld duplicate record%s.\n", (long)i, i > 1 ? "s" : ""); - while (--i >= 0) - readtape(buf); - } - } + while (--i >= 0) + readtape(buf); + } + } if (curfile.action == USING) { if (volno == 1) panic("active file into volume 1\n"); @@ -752,7 +752,7 @@ if (host) { if (rmtioctl(MTFSF, dumpnum - 1) < 0) { fprintf(stderr, "rmtioctl MTFSF: %s\n", strerror(errno)); - exit(1); + exit(1); } } else #endif @@ -787,7 +787,7 @@ #endif } -void +void printvolinfo(void) { int i; @@ -1079,7 +1079,7 @@ break; case EXT_XATTR: { char xattr[XATTR_MAXSIZE]; - + if (readxattr(xattr) == GOOD) { xattr_extract(path, xattr); break; @@ -1115,8 +1115,8 @@ timep[1].tv_usec = curfile.dip->di_mtime.tv_usec; mode = curfile.dip->di_mode; flags = curfile.dip->di_flags; - uid = curfile.dip->di_uid; - gid = curfile.dip->di_gid; + uid = curfile.dip->di_uid; + gid = curfile.dip->di_gid; switch (mode & IFMT) { @@ -1171,7 +1171,7 @@ ASDHeaderPtr hp; ASDEntryPtr ep; u_long loff; - u_int32_t uid; + u_int32_t uid; u_int32_t gid; u_int64_t di_size; char *p; @@ -1412,7 +1412,7 @@ if (ftruncate(ofile, origsize) < 0) warn("%s: ftruncate", curfile.name); } - if (!readingmaps) + if (!readingmaps) findinode(&spcl); gettingfile = 0; } @@ -1525,14 +1525,14 @@ if (cmperror) return; - + if (read(ifile, cmpbuf, size) != (ssize_t)size) { - fprintf(stderr, "%s: size has changed.\n", + fprintf(stderr, "%s: size has changed.\n", curfile.name); cmperror = 1; return; } - + if (memcmp(buf, cmpbuf, size) != 0) { fprintf(stderr, "%s: tape and disk copies are different\n", curfile.name); @@ -1552,9 +1552,9 @@ if (cmperror) return; - + if (read(ifile, cmpbuf, size) != (ssize_t)size) { - fprintf(stderr, "%s: size has changed.\n", + fprintf(stderr, "%s: size has changed.\n", curfile.name); cmperror = 1; return; @@ -1677,7 +1677,7 @@ tapefile, newname); } } - + /* don't unlink the file (it's not there anymore */ /* anyway) */ return (0); @@ -1697,7 +1697,7 @@ compareattr(char *name) { int xattr_done = 0; - + while (spcl.c_flags & DR_EXTATTRIBUTES) { switch (spcl.c_extattributes) { case EXT_MACOSFNDRINFO: @@ -1893,7 +1893,7 @@ if (!cmperror) { char c; if (read(ifile, &c, 1) != 0) { - fprintf(stderr, "%s: size has changed.\n", + fprintf(stderr, "%s: size has changed.\n", name); cmperror = 1; } @@ -1953,7 +1953,7 @@ static void readtape_set(char *buf) { - if (!zflag) + if (!zflag) readtape_func = readtape_uncompr; else { newcomprbuf(ntrec); @@ -2105,13 +2105,13 @@ /* * Read a compressed format block from a file or pipe and uncompress it. - * Attempt to handle read errors, and end of file. + * Attempt to handle read errors, and end of file. */ static void readtape_comprfile(char *buf) { long rl, size, i, ret; - int newvol; + int newvol; struct tapebuf *tpb; if (blkcnt < numtrec) { @@ -2298,7 +2298,7 @@ { /* If zflag is on, all blocks have a struct tapebuf prefix */ /* zflag gets set in setup() from the dump header */ - int cresult, blocklen; + int cresult, blocklen; unsigned long worklen; void *output = NULL; char *reason = NULL, *lengtherr = NULL; @@ -2319,7 +2319,7 @@ #ifndef HAVE_ZLIB errx(1,"This restore version doesn't support zlib decompression"); #else - cresult = uncompress(comprbuf, &worklen, + cresult = uncompress(comprbuf, &worklen, tpbin->buf, blocklen); output = comprbuf; switch (cresult) { @@ -2349,7 +2349,7 @@ #else unsigned int worklen2 = worklen; cresult = BZ2_bzBuffToBuffDecompress( - comprbuf, &worklen2, + comprbuf, &worklen2, tpbin->buf, blocklen, 0, 0); worklen = worklen2; output = comprbuf; @@ -2381,16 +2381,16 @@ errx(1,"This restore version doesn't support lzo decompression"); #else lzo_uint worklen2 = worklen; - cresult = lzo1x_decompress(tpbin->buf, blocklen, - comprbuf, &worklen2, NULL); + cresult = lzo1x_decompress(tpbin->buf, blocklen, comprbuf, + &worklen2, NULL); worklen = worklen2; output = comprbuf; switch (cresult) { case LZO_E_OK: break; - case LZO_E_ERROR: - case LZO_E_EOF_NOT_FOUND: - reason = "data error"; + case LZO_E_ERROR: + case LZO_E_EOF_NOT_FOUND: + reason = "data error"; break; default: reason = "unknown"; @@ -2457,7 +2457,7 @@ * readtape_set can set the correct function pointer for readtape(). * Note that the first block of each tape/file is not compressed * and does not have a prefix. - */ + */ static void findtapeblksize(void) { @@ -2485,7 +2485,7 @@ cvtflag++; if (converthead(&spclpt) == FAIL) { /* Special case for old compressed tapes with prefix */ - if (magtapein && (i % TP_BSIZE != 0)) + if (magtapein && (i % TP_BSIZE != 0)) goto oldformat; errx(1, "Tape is not a dump tape"); } @@ -2508,7 +2508,7 @@ "\'-b %d\' ", spclpt.c_ntrec); ntrec = spclpt.c_ntrec; len = (ntrec - 1) * TP_BSIZE; - zflag = 1; + zflag = 1; } else { /* read in the rest of the block based on bufsize */ @@ -2526,7 +2526,7 @@ /* * If the input is a tape, we tried to read ntrec * TP_BSIZE bytes. * If the value of ntrec is too large, we read less than - * what we asked for; adjust the value of ntrec and test for + * what we asked for; adjust the value of ntrec and test for * a compressed dump tape. */ if (i % TP_BSIZE != 0) { @@ -2580,7 +2580,7 @@ i = rmtread(buf, size); else #endif - i = read(fd, buf, size); + i = read(fd, buf, size); if (i <= 0) break; /* EOD or error */ @@ -2726,10 +2726,15 @@ memmove(buf->c_addr, u_ospcl.s_ospcl.c_fill, (long)256); } else if (u_ospcl.s_ospcl.c_magic == FS_UFS2_MAGIC) { - buf->c_date = (int32_t)(*(int64_t *)&u_ospcl.dummy[896]); - buf->c_ddate = (int32_t)(*(int64_t *)&u_ospcl.dummy[904]); - buf->c_tapea = (int32_t)(*(int64_t *)&u_ospcl.dummy[912]); - buf->c_firstrec = (int32_t)(*(int64_t *)&u_ospcl.dummy[920]); + int64_t i64; + memcpy(&i64, &u_ospcl.dummy[896], sizeof(i64)); + buf->c_date = i64; + memcpy(&i64, &u_ospcl.dummy[904], sizeof(i64)); + buf->c_ddate = i64; + memcpy(&i64, &u_ospcl.dummy[912], sizeof(i64)); + buf->c_tapea = i64; + memcpy(&i64, &u_ospcl.dummy[920], sizeof(i64)); + buf->c_firstrec = i64; buf->c_ntrec = 0; buf->c_extattributes = 0; buf->c_flags |= DR_NEWINODEFMT; @@ -2768,7 +2773,7 @@ buf->c_dinode.di_size = buf->c_count * TP_BSIZE; if (buf->c_count > TP_NINDIR) readmapflag = 1; - else + else for (i = 0; i < buf->c_count; i++) buf->c_addr[i]++; break; @@ -2817,7 +2822,7 @@ unsigned int compressed:1; } tb; swabst((u_char *)"i", (u_char *)tpb); - memcpy(&tb, tpb, 4); + memcpy(&tb, tpb, 4); tpb->length = tb.length; tpb->flags = tb.flags; tpb->compressed = tb.compressed; @@ -2838,10 +2843,10 @@ if (header->c_type == TS_TAPE) { fprintf(stderr, "Volume header (%s inode format) ", oldinofmt ? "old" : "new"); - if (header->c_firstrec) - fprintf(stderr, "begins with record %d", - header->c_firstrec); - fprintf(stderr, "\n"); + if (header->c_firstrec) + fprintf(stderr, "begins with record %d", + header->c_firstrec); + fprintf(stderr, "\n"); previno = 0x7fffffff; return; } @@ -2948,7 +2953,7 @@ if (!noresyncmesg) #endif fprintf(stderr, "resync restore, skipped %ld blocks\n", - skipcnt); + skipcnt); skipcnt = 0; } @@ -3115,19 +3120,19 @@ extern int fdsmtc; struct uscsi_cmd { - int uscsi_flags; /* read, write, etc. see below */ - short uscsi_status; /* resulting status */ - short uscsi_timeout; /* Command Timeout */ - caddr_t uscsi_cdb; /* cdb to send to target */ - caddr_t uscsi_bufaddr; /* i/o source/destination */ - u_int uscsi_buflen; /* size of i/o to take place */ - u_int uscsi_resid; /* resid from i/o operation */ - u_char uscsi_cdblen; /* # of valid cdb bytes */ - u_char uscsi_rqlen; /* size of uscsi_rqbuf */ - u_char uscsi_rqstatus; /* status of request sense cmd */ - u_char uscsi_rqresid; /* resid of request sense cmd */ - caddr_t uscsi_rqbuf; /* request sense buffer */ - void *uscsi_reserved_5; /* Reserved for Future Use */ + int uscsi_flags; /* read, write, etc. see below */ + short uscsi_status; /* resulting status */ + short uscsi_timeout; /* Command Timeout */ + caddr_t uscsi_cdb; /* cdb to send to target */ + caddr_t uscsi_bufaddr; /* i/o source/destination */ + u_int uscsi_buflen; /* size of i/o to take place */ + u_int uscsi_resid; /* resid from i/o operation */ + u_char uscsi_cdblen; /* # of valid cdb bytes */ + u_char uscsi_rqlen; /* size of uscsi_rqbuf */ + u_char uscsi_rqstatus; /* status of request sense cmd */ + u_char uscsi_rqresid; /* resid of request sense cmd */ + caddr_t uscsi_rqbuf; /* request sense buffer */ + void *uscsi_reserved_5; /* Reserved for Future Use */ }; #define CDB_GROUP0 6 /* 6-byte cdb's */ @@ -3258,7 +3263,7 @@ } if (err) { err = errno; - fprintf(stdout, "[%ld] error: %d (getting tapepos: %lld)\n", + fprintf(stdout, "[%ld] error: %d (getting tapepos: %lld)\n", (unsigned long)getpid(), err, *pos); return err; } @@ -3292,7 +3297,7 @@ } if (err) { err = errno; - fprintf(stdout, "[%ld] error: %d (setting tapepos: %lld)\n", + fprintf(stdout, "[%ld] error: %d (setting tapepos: %lld)\n", (unsigned long)getpid(), err, pos); return err; } diff -Nru dump-0.4b45/restore/utilities.c dump-0.4b46/restore/utilities.c --- dump-0.4b45/restore/utilities.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/restore/utilities.c 2016-06-08 05:01:45.000000000 +0000 @@ -575,7 +575,7 @@ *pp++ = *p++; tmpino = atol(numbuff); if (*p == 0) - return 1; /* may NOT happen */ + return 1; /* may NOT happen */ p++; bzero(numbuff, sizeof(numbuff)); pp = numbuff; @@ -583,7 +583,7 @@ while ((*p != 0) && (*p != '\t')) *pp++ = *p++; if (*p == 0) - return 1; /* may NOT happen */ + return 1; /* may NOT happen */ tmptnum = atol(numbuff); p++; bzero(numbuff, sizeof(numbuff)); @@ -686,7 +686,7 @@ bzero(&hp->filler, sizeof(hp->filler)); hp->entries = (short)n; - + ep->entryID = EntryFinderInfo; ep->offset = p - pp - CORRECT; ep->len = INFOLEN; /* sizeof(MacFInfo) + sizeof(FXInfo); */ diff -Nru dump-0.4b45/restore/xattr.c dump-0.4b46/restore/xattr.c --- dump-0.4b45/restore/xattr.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/restore/xattr.c 2016-06-08 05:01:45.000000000 +0000 @@ -110,14 +110,14 @@ /* * On-block xattr value offsets start at the beginning of the block, but - * on-inode xattr value offsets start after the initial header + * on-inode xattr value offsets start after the initial header * (ext3_xattr_ibody_header). */ #define VALUE_OFFSET(buffer, entry) \ (((HDR(buffer)->h_magic == EXT2_XATTR_MAGIC2) ? \ (entry)->e_value_offs + sizeof(struct ext3_xattr_ibody_header) : \ (entry)->e_value_offs)) - + /* * xattr syscalls do not exist yet in libc, get our own copy here, * taken from libattr. @@ -430,12 +430,12 @@ else #endif err = lsetxattr(path, name, value, valuelen, 0); - + if (err) { warn("%s: EA set %s:%s failed", path, name, value); return FAIL; } - + return GOOD; } @@ -445,18 +445,18 @@ char *path = (char *)private; char valuef[XATTR_MAXSIZE]; int valuesz; - + isSELinux; #ifdef TRANSSELINUX /*GAN6May06 SELinux MLS */ if (isSELinux) { security_context_t con = NULL; - + if (lgetfilecon(path, &con) < 0) { warn("%s: EA compare lgetfilecon failed\n", path); return FAIL; } - + valuesz = strlen(con) + 1; valuef[0] = 0; strncat(valuef, con, sizeof(valuef) - 1); @@ -472,7 +472,7 @@ #ifdef TRANSSELINUX /*GAN6May06 SELinux MLS */ } #endif - + if (valuesz != valuelen || memcmp(value, valuef, valuelen)) { /* GAN24May06: show name and new value for user to compare */ fprintf(stderr, "%s: EA %s:%s value changed to %s\n", path, name, value, valuef); @@ -498,7 +498,7 @@ HDR(buffer)->h_magic != EXT2_XATTR_MAGIC2) { fprintf(stderr, "error in EA block 1\n"); fprintf(stderr, "magic = %x\n", HDR(buffer)->h_magic); - + return FAIL; } @@ -545,7 +545,7 @@ /* list the attribute names */ for (entry = FIRST_ENTRY(buffer); !IS_LAST_ENTRY(entry); entry = EXT2_XATTR_NEXT(entry)) { - char name[XATTR_MAXSIZE], value[XATTR_MAXSIZE]; + char name[XATTR_MAXSIZE], value[XATTR_MAXSIZE]; int size; int off; int convertacl = 0; @@ -598,23 +598,22 @@ return FAIL; free(acl); } - + #ifdef TRANSSELINUX /*GAN6May06 SELinux MLS */ if (convertcon && strcmp(name, "security.selinux")) convertcon = 0; /*GAN24May06 only for selinux */ - - if (convertcon) - { + + if (convertcon) { security_context_t con = NULL; int err; - + if (!transselinuxarg) err = security_canonicalize_context(value, &con); else { strncat(value, transselinuxarg, sizeof(value) - 1); err = security_canonicalize_context_raw(value, &con); } - + if (err < 0) { warn("%s: EA canonicalize failed\n", value); return FAIL; @@ -705,4 +704,3 @@ return xattr_walk(buffer, xattr_cb_set, path); } - diff -Nru dump-0.4b45/rmt/Makefile.am dump-0.4b46/rmt/Makefile.am --- dump-0.4b45/rmt/Makefile.am 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/rmt/Makefile.am 2016-06-08 05:01:45.000000000 +0000 @@ -16,7 +16,7 @@ rmt_LDADD = ../compat/lib/libcompat.la $(EXT2FS_LIBS) ermt_SOURCES = ermt.c cipher.c -ermt_LDADD = ../compat/lib/libcompat.la $(EXT2FS_LIBS) +ermt_LDADD = ../compat/lib/libcompat.la $(EXT2FS_LIBS) $(SSL_LIBS) rmt.8: rmt.8.in $(AM_V_GEN)\ diff -Nru dump-0.4b45/rmt/Makefile.in dump-0.4b46/rmt/Makefile.in --- dump-0.4b45/rmt/Makefile.in 2016-05-09 06:36:02.000000000 +0000 +++ dump-0.4b46/rmt/Makefile.in 2016-09-05 19:25:28.000000000 +0000 @@ -100,7 +100,8 @@ am_ermt_OBJECTS = ermt.$(OBJEXT) cipher.$(OBJEXT) ermt_OBJECTS = $(am_ermt_OBJECTS) am__DEPENDENCIES_1 = -ermt_DEPENDENCIES = ../compat/lib/libcompat.la $(am__DEPENDENCIES_1) +ermt_DEPENDENCIES = ../compat/lib/libcompat.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -277,7 +278,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ -SSLLIB = @SSLLIB@ +SSL_CFLAGS = @SSL_CFLAGS@ +SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ @@ -343,7 +345,7 @@ rmt_SOURCES = rmt.c rmt_LDADD = ../compat/lib/libcompat.la $(EXT2FS_LIBS) ermt_SOURCES = ermt.c cipher.c -ermt_LDADD = ../compat/lib/libcompat.la $(EXT2FS_LIBS) +ermt_LDADD = ../compat/lib/libcompat.la $(EXT2FS_LIBS) $(SSL_LIBS) all: all-am .SUFFIXES: diff -Nru dump-0.4b45/rmt/rmt.c dump-0.4b46/rmt/rmt.c --- dump-0.4b45/rmt/rmt.c 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/rmt/rmt.c 2016-06-08 05:01:45.000000000 +0000 @@ -80,13 +80,13 @@ * the ioctl commands to the UNIX "standard", as per: * ftp://ftp.fokus.gmd.de/pub/unix/star/README.mtio * - * In order to use rmt version 1, a client must send "I-1\n0\n" + * In order to use rmt version 1, a client must send "I-1\n0\n" * before issuing the other I commands. */ static int rmt_version = 0; #define RMTI_VERSION -1 #define RMT_VERSION 1 - + /* Extended 'i' commands */ #define RMTI_CACHE 0 #define RMTI_NOCACHE 1 @@ -94,7 +94,7 @@ #define RMTI_ERASE 3 #define RMTI_EOM 4 #define RMTI_NBSF 5 - + /* Extended 's' comands */ #define MTS_TYPE 'T' #define MTS_DSREG 'D' @@ -318,8 +318,8 @@ if (atoi(op) == RMTI_VERSION) { rval = RMT_VERSION; rmt_version = 1; - } - else { + } + else { struct mtop mtop; mtop.mt_op = -1; if (rmt_version) { @@ -400,7 +400,7 @@ case 'i': { struct mtop mtop; - + getstring (op); getstring (count); DEBUG2 ("rmtd: i %s %s\n", op, count); @@ -489,13 +489,13 @@ case 's': { char s; struct mtget mtget; - + DEBUG ("rmtd: s\n"); if (read (0, &s, 1) != 1) goto top; DEBUG1 ("rmtd: s %d\n", s); - + if (ioctl (tape, MTIOCGET, (char *) &mtget) < 0) { goto ioerror; } diff -Nru dump-0.4b45/TODO dump-0.4b46/TODO --- dump-0.4b45/TODO 2016-05-06 02:55:40.000000000 +0000 +++ dump-0.4b46/TODO 2016-06-08 05:01:45.000000000 +0000 @@ -13,13 +13,13 @@ 1. More documentation? Examples, crontab? -2. Explore and correct dump problems on active filesystems +2. Explore and correct dump problems on active filesystems (lseek/read negative count) (This should be OK as of 0.4b14. Unfortunately, this seems to continue for a very few users). 3. 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 + 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). The BSD code in traverse.c (all those #ifdef _BSD) should go into the ffs backend.