Sync from SUSE:SLFO:Main dump revision caf122f8090d0629a81bae7a89e084f8

This commit is contained in:
Adrian Schröter 2024-12-20 16:22:25 +01:00
commit 60eaf0a126
9 changed files with 1225 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

13
dump-0.4b43-include.patch Normal file
View File

@ -0,0 +1,13 @@
Index: b/dump/main.c
===================================================================
--- a/dump/main.c
+++ b/dump/main.c
@@ -60,6 +60,8 @@
#include <ext2fs/ext2fs.h>
#include <sys/stat.h>
#include <bsdcompat.h>
+
+#define pgoff_t unsigned long
#include <linux/fs.h> /* for definition of BLKFLSBUF */
#include <protocols/dumprestore.h>

View File

@ -0,0 +1,53 @@
Index: b/dump/dump.8.in
===================================================================
--- a/dump/dump.8.in
+++ b/dump/dump.8.in
@@ -211,7 +211,7 @@ exist, dump doesn't create a new remote
The default path name of the remote
.BR rmt (8)
program is
-.IR /etc/rmt ;
+.IR /usr/bin/rmt ;
this can be overridden by the environment variable
.BR RMT .
.TP
Index: b/dump/Makefile.am
===================================================================
--- a/dump/Makefile.am
+++ b/dump/Makefile.am
@@ -5,7 +5,6 @@ EXTRA_DIST =
man_MANS = dump.8
DISTCLEANFILES += dump.8
EXTRA_DIST += dump.8.in
-dist_man_MANS = rdump.8
sbin_PROGRAMS = dump
@@ -20,7 +19,6 @@ dump.8: dump.8.in
install-exec-hook:
$(MKDIR_P) $(DESTDIR)$(sbindir)
- $(LN_S) dump $(DESTDIR)$(sbindir)/rdump
uninstall-hook:
$(RM) -f $(DESTDIR)$(sbindir)/rdump
Index: b/restore/Makefile.am
===================================================================
--- a/restore/Makefile.am
+++ b/restore/Makefile.am
@@ -5,7 +5,6 @@ EXTRA_DIST =
man_MANS = restore.8
DISTCLEANFILES += restore.8
EXTRA_DIST += restore.8.in
-dist_man_MANS = rrestore.8
sbin_PROGRAMS = restore
@@ -22,7 +21,6 @@ restore.8: restore.8.in
install-exec-hook:
$(MKDIR_P) $(DESTDIR)$(sbindir)
- $(LN_S) restore $(DESTDIR)$(sbindir)/rrestore
uninstall-hook:
$(RM) -f $(DESTDIR)$(sbindir)/rrestore

View File

@ -0,0 +1,79 @@
From: Alexey Svistunov <svalx@svalx.net>
Date: 2017-03-21 12:22:00 +0300
Subject: Independent rmt and ermt build, change its locations to _bindir
References:
Upstream: submitted
Index: b/rmt/Makefile.am
===================================================================
--- a/rmt/Makefile.am
+++ b/rmt/Makefile.am
@@ -1,17 +1,23 @@
AM_CPPFLAGS = -I$(top_srcdir)/compat/include
DISTCLEANFILES =
EXTRA_DIST =
+bin_PROGRAMS =
+man_MANS =
-sbin_PROGRAMS = rmt
+if BUILD_RMT
+bin_PROGRAMS += rmt
+man_MANS += rmt.8
+DISTCLEANFILES += rmt.8
+EXTRA_DIST += rmt.8.in
+endif
if BUILD_ERMT
-sbin_PROGRAMS += ermt
+bin_PROGRAMS += ermt
+man_MANS += ermt.1
+DISTCLEANFILES += ermt.1
+EXTRA_DIST += ermt.1.in
endif
-man_MANS = rmt.8
-DISTCLEANFILES += rmt.8
-EXTRA_DIST += rmt.8.in
-
rmt_SOURCES = rmt.c rmt.h
rmt_LDADD = ../compat/lib/libcompat.la $(EXT2FS_LIBS)
@@ -22,3 +28,8 @@ rmt.8: rmt.8.in
$(AM_V_GEN)\
sed -e "s|__DATE__|$(DATE)|g" \
-e "s|__VERSION__|$(VERSION)|g" $< > $@
+ermt.1: ermt.1.in
+ $(AM_V_GEN)\
+ sed -e "s|__DATE__|$(DATE)|g" \
+ -e "s|__VERSION__|$(VERSION)|g" $< > $@
+
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -87,9 +87,6 @@ AC_MSG_CHECKING([whether to build ermt])
BUILD_ERMT=no
AC_ARG_ENABLE([ermt], [AS_HELP_STRING([--enable-ermt],[compile ermt, an encrypting version of rmt @<:@default=no@:>@])])
if test "$enable_ermt" = "yes"; then
- if test "$BUILD_RMT" != "yes"; then
- AC_MSG_ERROR([ermt requires --enable-rmt])
- fi
BUILD_ERMT=yes
fi
AM_CONDITIONAL([BUILD_ERMT], [test "$BUILD_ERMT" = "yes"])
Index: b/Makefile.am
===================================================================
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = compat/lib common dump restore faketape
-if BUILD_RMT
-SUBDIRS += rmt
-endif
+SUBDIRS = compat/lib common dump restore rmt faketape
EXTRA_DIST = \
dump.lsm KNOWNBUGS MAINTAINERS REPORTING-BUGS \

BIN
dump-0.4b49.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

475
dump.changes Normal file
View File

@ -0,0 +1,475 @@
-------------------------------------------------------------------
Tue Dec 17 20:03:34 UTC 2024 - Antonio Teixeira <antonio.teixeira@suse.com>
- Update to 0.4b49:
* Reworking of regression tests and test harness
* Import some patches from the Debian package.
* restore -N should never change the fs. Fixes #154
* Support outputting list of files from restore -t with '\0' separator
(Patch from debian bug 703564 by Heiko Schlittermann)
* Fix reading of QFA file when listing tape.
* Support restoring to filesystems with a blocksize that isn't a multiple
of TP_BSIZE (debian bug 995992). This is a different fix to the one
currently in debian. The advantage of using a common multiple, if
available, is that every FS block will only be written to once.
Fixed an issue where the alignment between blocksize and writing pos
becomes misaligned when a sparse hole doesn't occupy a full fs block
(happens when restoring to a FS with a different, larger blocksize than
the one the dump was taken on.
* Numerous other minor patches from the Debian package
* Don't read off end of buffer when restoring symlinks
* Fix some weirdness around dumping a subdirectory. Do not include the
inodes for all of the items in the subdirectories - which then give a
restore error "inode not found on tape"
* Fix EA problem when EAs blocks are read immediately before a tape change.
* Allow compressed dumps to work when -b blocksize setting is the maximum
a tape drive supports.
* Remove code added for building on systems other than __linux__
* Major reworking of how reading from disk and tape works. Dump now
supports writing a compressed dump to a file and then writing that to
tape. There is now only one "read" function. We do not have separate
functions for reading tapes, files, compressed tapes, compressed files.
* Improve the efficiency of TS_ADDR (and TS_INODE) record for
representing larger files. A single TS_ADDR record can now represent up
to 4GB of file rather than just 512K. Dumps written by 0.4b49 cannot be
restored using 0.4b48 and before.
- 0.4b48 changelog:
* Handle fs with more than 2^32 blocks (Greg Oster)
* Handle EA stored in blocks with address >2^32.
* Handle the case were EAs are stored across two blocks. Fixes several
reported bugs regarding the restore of directory attributes.
Additionally, now restore -C passes too. Originally restore -C was
patched for files, but not directories, in debian bug#940473 by
Alexander Zangerl. Substantially redone and extended to directory
attributes here.
* Do not record garbage data in dump for files with
EXT2_EXTENT_FLAGS_UNINIT set indicating that the disk block has not
been written to and should be assumed to be all zeros.
* Dump small files on ext4 partitions with -O inline-data set.
* Major performance enhancements on the restoring and verifying of very
sparse files.
* Handle dumps that are over 2^32 (tape) blocks long (>4T)
* Handle restoring sparse files that start with a hole from dump versions
0.4b42/43. Previously they were restored but corrupted as some of the
initial hole was moved to the end.
* Many cleanups. Move to autoconf v0.71. Remove need to build with
-fcommon. Build with -W -Wall and without compiler warnings. Add some
compile time checks for structures that are written to tape and must
not change.
* Extensive regression tests. Every bug fixed by 0.4b48 release is now
covered by a regression test along with testing the restore of a historical
dump created by the previous versions from 0.4b5 through 0.4b47.
- Use autopatch
- Refresh patches
-------------------------------------------------------------------
Mon Feb 26 07:54:58 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %patch -P N instead of deprecated %patchN.
-------------------------------------------------------------------
Fri Jul 16 15:28:17 UTC 2021 - Danilo Spinella <danilo.spinella@suse.com>
- Update to 0.4b47:
* Fix missing lzo return (Alexey Svistunov).
* Fix building with OpenSSL 1.1 (Daniel Molkentin).
* Fix bashisms in examples (Oleksandr Chumachenko).
* Use xattrs funcs from the C library (Vaclav Dolezal).
* Fix date mangling in man pages (Mike Frysinger).
* Force -fcommon when building (Mike Frysinger).
* Add error checking to SSL init transformation (Mike Frysinger).
* Fix restore -C calls with ftruncate (Alexander Zangerl).
* Restore symlink timestamps (Alexander Zangerl).
- Remove upstreamed patches:
* dump-0.4b43-fix-bashisms.patch
* dump-0.4b46-lzo-no-return.patch
* dump-0.4b46-openssl-1.1.patch
- Run spec-cleaner
-------------------------------------------------------------------
Sun Mar 29 21:05:53 UTC 2020 - Kristyna Streitova <kstreitova@suse.com>
- starting with GCC 10, the default of '-fcommon' option will
change to '-fno-common'. Because dump build fails with
'fno-common', add '-fcommon' option to optflags as a temporary
workaround for this problem till it's properly fixed [bsc#1160263]
-------------------------------------------------------------------
Thu Jun 15 12:33:17 UTC 2017 - tchvatal@suse.com
- Add sqlite3 dependency and enable building with it
-------------------------------------------------------------------
Thu Jun 15 09:12:51 UTC 2017 - daniel.molkentin@suse.com
- Compile with OpenSSL 1.1 (bsc#1042637)
- add patches:
* dump-0.4b46-openssl-1.1.patch
-------------------------------------------------------------------
Mon Mar 27 11:43:24 UTC 2017 - mpluskal@suse.com
- Conform to packaging guidelines with update-alternatives
- Clenaup with spec-cleaner
-------------------------------------------------------------------
Tue Mar 21 10:13:12 UTC 2017 - svalx@svalx.net
- Update to 0.4b44
* Improve data throughput when using compression in dump by
allowing multiple slaves to compress in parallel. Thanks
to Phillip Susi <psusi@cfl.rr.com> for the patch.
* Add dump encryption support and reorganise the whole
compression/encryption code as plugins. Thanks to
Bear Giles <bgiles@coyotesong.com> for the patch.
* Add sqlite index support and reorganize the QFA code
as plugins. Thanks to Bear Giles <bgiles@coyotesong.com> for
the patch.
* Lots of various build cleanups and minor bugfixes.
* Use pkg-config to locate openssl dependencies to fix ermt linking.
* Fix building when QFA code is disabled (Alexander Zangerl).
* Fix crash with the -Q option (Alexander Zangerl).
* Fix crash with legacy indexer (Alexander Zangerl).
* Fix handling of the -A flag.
* Fix compression enabling logic (Alexander Zangerl).
* Skip unhandled fstab entries (Josef Ridky).
- Add ermt (1) man page
- A new version of dump have an updated make system, because of this
* remove patches dump-0.4b43-configure.patch, dump-0.4b43-destdir.patch, dump-buildfix.patch
* rebase patch dump-0.4b43-pathnames.patch to dump-0.4b46-pathnames.patch
- Add dump-0.4b46-lzo-no-return.patch - fixing rpmlint
no-return-in-nonvoid-function error in dump
- Add dump-0.4b46-rmt-ermt.patch - independent rmt and ermt build,
change its locations to _bindir
- Cleanup spec file with spec-cleaner
- Separated rmt subpackage
- Alternatives system for rmt/ermt
-------------------------------------------------------------------
Fri May 1 15:16:02 UTC 2015 - mpluskal@suse.com
- Enable ermt support
- Update dependencies
-------------------------------------------------------------------
Tue Feb 24 18:37:52 UTC 2015 - mpluskal@suse.com
- Cleanup spec file with spec-cleaner
- Update urls
- Add patch dump-buildfix.patch
- Update to 0.4b44
* Recognize ext4 partitions in dump -w commands (Sourceforge bug
#3125587, RedHat bug #658890).
* Fix an issue with multi volume backups, which breaks restoring
of files which are splitted on two or more volumes and are
starting on 2nd tape or later (RedHat bug #507948).
* Fix a bug in dump when dumping files with holes. This bug was
introduced in 0.4b42 while adding ext4 support. (Sourceforge
bug #3133762).
* Fix a bug in restore -P where useless index files for
compressed dumps were created (Debian bug #583093).
* Fix SYS_clone invocation on s390 architectures (Sourceforge
bug #3303235).
* Fix static builds.
* Add quick regression script from Bear Giles.
* Fix a bug introduced in 0.4b43 causing restore to crash when
asking for a new volume when doing multi-volume restores.
-------------------------------------------------------------------
Sun Nov 16 21:32:00 UTC 2014 - Led <ledest@gmail.com>
- fix bashisms in example scripts
- add patches:
* dump-0.4b43-fix-bashisms.patch
-------------------------------------------------------------------
Sat Jan 12 07:47:47 UTC 2013 - coolo@suse.com
- remove suse_update_config
-------------------------------------------------------------------
Fri Dec 2 12:41:38 UTC 2011 - coolo@suse.com
- add automake as buildrequire to avoid implicit dependency
-------------------------------------------------------------------
Sun Sep 18 17:17:12 UTC 2011 - jengelh@medozas.de
- Remove redundant tags/sections from specfile
(cf. packaging guidelines)
- Use %_smp_mflags for parallel build
-------------------------------------------------------------------
Thu Sep 30 11:17:34 CEST 2010 - nadvornik@suse.cz
- updated to 0.4b43
* ext4 support
* selinux improvements
* bugfixes, see CHANGES file
-------------------------------------------------------------------
Sat Mar 31 18:36:12 CEST 2007 - rguenther@suse.de
- add zlib-devel BuildRequires
-------------------------------------------------------------------
Wed Jan 25 21:35:36 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Sat Jan 14 22:23:46 CET 2006 - schwab@suse.de
- Don't strip binaries.
-------------------------------------------------------------------
Tue Jan 3 12:16:26 CET 2006 - nadvornik@suse.cz
- updated to 0.4b41
* ACL fixes
-------------------------------------------------------------------
Mon Jul 25 16:41:44 CEST 2005 - nadvornik@suse.cz
- do not install rmt
-------------------------------------------------------------------
Fri Jul 15 14:55:12 CEST 2005 - nadvornik@suse.cz
- updated to 0.4b40
* support for extended attributes (ACL)
-------------------------------------------------------------------
Tue Apr 19 16:59:36 CEST 2005 - nadvornik@suse.de
- fixed including of linux/fs.h
-------------------------------------------------------------------
Tue Jan 25 13:01:58 CET 2005 - nadvornik@suse.cz
- updated to 0.4b39
-------------------------------------------------------------------
Wed Sep 01 11:56:46 CEST 2004 - nadvornik@suse.cz
- updated to 0.4b37
-------------------------------------------------------------------
Wed Jun 2 00:54:31 CEST 2004 - ro@suse.de
- avoid inclusion of linux/audit.h
-------------------------------------------------------------------
Tue Feb 10 08:32:01 CET 2004 - kukuk@suse.de
- Fix compiling on 64bit architectures
-------------------------------------------------------------------
Thu Feb 05 17:02:44 CET 2004 - nadvornik@suse.cz
- updated to 0.4b35
-------------------------------------------------------------------
Fri Aug 01 12:19:47 CEST 2003 - nadvornik@suse.cz
- fixed to compile on x86_64
-------------------------------------------------------------------
Wed Jul 23 16:48:05 CEST 2003 - nadvornik@suse.cz
- update to 0.4b34, fixes [#27810]
-------------------------------------------------------------------
Mon Feb 17 17:15:10 CET 2003 - nadvornik@suse.cz
- updated to 0.4b33
-------------------------------------------------------------------
Thu Aug 29 11:57:59 CEST 2002 - nadvornik@suse.cz
- updated to 0.4b31:
- fixed rmt open flags transmission (remote dump was broken in 0.4b29)
- fixed the tape length calculation when using large tapes and compression
- made dump save 32 bit UID/GID
-------------------------------------------------------------------
Tue Jul 2 10:34:22 CEST 2002 - nadvornik@suse.cz
- updated to 0.4b29
- bugfixes
- more examples
-------------------------------------------------------------------
Thu Apr 18 15:12:14 CEST 2002 - nadvornik@suse.cz
- updated to 0.4b28
- bugfixes
- do not include kernel haders
- compiled with readline
-------------------------------------------------------------------
Tue Apr 2 11:22:02 CEST 2002 - nadvornik@suse.cz
- fixed to compile with new autoconf
-------------------------------------------------------------------
Wed Jan 30 16:27:45 CET 2002 - nadvornik@suse.cz
- update to 0.4b26:
- more examples
- bugfixes
-------------------------------------------------------------------
Mon Jan 7 12:04:25 CET 2002 - nadvornik@suse.cz
- added link /etc/rmt -> /sbin/rmt for compatibility [bug #12615]
-------------------------------------------------------------------
Thu Nov 22 10:56:29 CET 2001 - nadvornik@suse.cz
- update to 0.4b25:
- more documentation
- added bzip2 compression
- suport for backups to CD
- bugfixes
-------------------------------------------------------------------
Fri Aug 17 14:21:31 CEST 2001 - nadvornik@suse.cz
- added fix for traverse.c
-------------------------------------------------------------------
Thu Aug 16 00:12:55 CEST 2001 - ro@suse.de
- up to 0.4b23 to make it build with new e2fsprogs
-------------------------------------------------------------------
Tue Feb 27 11:29:53 CET 2001 - nadvornik@suse.cz
- update to 0.4b21
-------------------------------------------------------------------
Fri Feb 23 00:10:25 CET 2001 - ro@suse.de
- added readline/readline-devel to neededforbuild (split from bash)
-------------------------------------------------------------------
Thu Feb 22 18:21:37 CET 2001 - schwab@suse.de
- Fix missing includes.
- Replace ino_t by __ino_t instead of unsigned int.
- Don't kill entire process group on crash.
-------------------------------------------------------------------
Fri Feb 9 13:00:16 CET 2001 - uli@suse.de
- fixed for glibc 2.2.1
-------------------------------------------------------------------
Thu Jan 11 15:25:20 CET 2001 - nadvornik@suse.cz
- added lfs patch
-------------------------------------------------------------------
Tue Dec 5 14:18:50 CET 2000 - smid@suse.cz
- path to rmt changed [#4306]
-------------------------------------------------------------------
Sun Dec 3 15:17:15 CET 2000 - smid@suse.cz
- new version 0.4b20
-------------------------------------------------------------------
Thu Nov 9 00:05:49 CET 2000 - ro@suse.de
- fixed neededforbuild
-------------------------------------------------------------------
Fri Sep 29 10:42:05 CEST 2000 - smid@suse.cz
- new version 0.4b19
-------------------------------------------------------------------
Fri Apr 7 15:05:24 CEST 2000 - smid@suse.cz
- upgrade to 0.4b16
- buildroot added
-------------------------------------------------------------------
Thu Mar 2 14:37:16 CET 2000 - kukuk@suse.de
- Update to version 0.4b15 and correct security fix
-------------------------------------------------------------------
Thu Feb 10 16:49:19 CET 2000 - kukuk@suse.de
- Update to version 0.4b14
-------------------------------------------------------------------
Sun Jan 30 17:46:55 CET 2000 - kukuk@suse.de
- Update to version 0.4b13
- Move /usr/man -> /usr/share/man
-------------------------------------------------------------------
Mon Dec 6 16:18:54 MET 1999 - kukuk@suse.de
- Update to version 0.4b11 (BUG #1448)
- Fix dump manual page (BUG #1367)
-------------------------------------------------------------------
Sat Nov 13 13:48:01 MET 1999 - kukuk@suse.de
- Compile without ext2fs progs, but use ext2fs development package
-------------------------------------------------------------------
Mon Nov 8 12:39:32 MET 1999 - kukuk@suse.de
- Security update for dump to 0.4b9
-------------------------------------------------------------------
Fri Oct 29 10:36:28 CEST 1999 - ro@suse.de
- fixed spec for e2fsprogs-1.17
-------------------------------------------------------------------
Mon Oct 25 00:02:14 CEST 1999 - ro@suse.de
- fixed spec for e2fsprogs-1.16
-------------------------------------------------------------------
Mon Oct 18 16:13:55 MEST 1999 - kukuk@suse.de
- Update to version 0.4b7
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
-------------------------------------------------------------------
Tue Aug 31 11:03:02 CEST 1999 - ro@suse.de
- changed for e2fsprogs-1.15 / only do install-lib
-------------------------------------------------------------------
Sat Jun 26 18:40:37 MEST 1999 - kukuk@suse.de
- Update to dump 0.4b4
-------------------------------------------------------------------
Tue Sep 1 17:28:14 MEST 1998 - ro@suse.de
- use e2fsprgs-1.12-sources / dont use -lbsd
-------------------------------------------------------------------
Mon Oct 20 16:12:36 MEST 1997 - ro@suse.de
- ready for autobuild
minor patch in dump/traverse.c
----------------------------------------------------------------------------
Sat Sep 21 01:18:40 MET DST 1996 - florian@suse.de
- recompile to use newer and static ext2 libraries

120
dump.spec Normal file
View File

@ -0,0 +1,120 @@
#
# spec file for package dump
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: dump
Version: 0.4b49
Release: 0
Summary: Programs for backing up and restoring ext2/3/4 filesystems
License: BSD-3-Clause
Group: Productivity/Archiving/Backup
URL: http://dump.sourceforge.net
Source0: http://sourceforge.net/projects/%{name}/files/%{name}/%{version}/%{name}-%{version}.tar.gz
Source1: ermt.1.in
# PATCH-FIX-SUSE dump-0.4b46-pathnames.patch svalx@svalx.net -- pathnames and
# symlinks configuration for dump and restore
Patch0: %{name}-0.4b46-pathnames.patch
# PATCH-FIX-UPSTREAM dump-0.4b46-rmt-ermt.patch svalx@svalx.net -- Independent rmt and
# ermt build, change its locations to _bindir
Patch1: %{name}-0.4b46-rmt-ermt.patch
Patch3: %{name}-0.4b43-include.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: e2fsprogs-devel
BuildRequires: libbz2-devel
BuildRequires: libselinux-devel
BuildRequires: libtool
BuildRequires: lzo-devel
BuildRequires: openssl-devel
BuildRequires: readline-devel
BuildRequires: sqlite3-devel
BuildRequires: zlib-devel
Recommends: %{name}-rmt = %{version}
Recommends: mt
%description
The dump package contains both dump and restore. Dump examines files
in a file system, determines which ones need to be backed up, and
copies those files to a specified disk, tape, or other storage medium.
The restore command performs the inverse function of dump. It can
restore a full backup of a file system.
%package rmt
Summary: Provides certain programs with access to remote tape devices
Group: Productivity/Archiving/Backup
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: rmt
%description rmt
The rmt utility provides remote access to tape devices for programs
like dump (a filesystem backup program), restore (a program for
restoring files from a backup), tar (an archiving program) and cpio.
%prep
%setup -q
cp %{SOURCE1} rmt/
%autopatch -p1
%build
autoreconf -fiv
export CFLAGS="%{optflags} -fcommon"
%configure \
--disable-silent-rules \
--enable-sqlite \
--enable-ermt \
--enable-rmt=no \
--with-rmtpath=%{_bindir}
%make_build
%install
%make_install
mv examples/encrypted_rmt .
# Alternatives system
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -sf %{_sysconfdir}/alternatives/rmt %{buildroot}%{_bindir}/rmt
ln -sf %{_sysconfdir}/alternatives/rmt.1%{ext_man} %{buildroot}%{_mandir}/man1/rmt.1%{ext_man}
%post rmt
%{_sbindir}/update-alternatives --force \
--install %{_bindir}/rmt rmt %{_bindir}/ermt 20 \
--slave %{_mandir}/man1/rmt.1%{ext_man} rmt.1%{ext_man} %{_mandir}/man1/ermt.1%{ext_man}
%postun rmt
if [ ! -f %{_bindir}/ermt ] ; then
"%{_sbindir}/update-alternatives" --remove rmt %{_bindir}/ermt
fi
%files
%{_sbindir}/dump
%{_sbindir}/restore
%{_mandir}/man8/dump.8%{?ext_man}
%{_mandir}/man8/restore.8%{?ext_man}
%license COPYING
%doc NEWS KNOWNBUGS MAINTAINERS README REPORTING-BUGS
%doc AUTHORS TODO dump.lsm examples
%files rmt
%ghost %{_bindir}/rmt
%{_bindir}/ermt
%ghost %{_mandir}/man1/rmt.1%{ext_man}
%{_mandir}/man1/ermt.1%{?ext_man}
%ghost %{_sysconfdir}/alternatives/rmt
%ghost %{_sysconfdir}/alternatives/rmt.1%{ext_man}
%doc encrypted_rmt/README
%changelog

18
dump.test Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh -x
umount /mnt
cd /
dd if=/dev/zero of=/testd1 count=10000
mke2fs -F /testd1
dd if=/dev/zero of=/testd2 count=10000
mke2fs -F /testd2
mount -o loop /testd1 /mnt
cd /mnt
dd if=/dev/zero of=test1 count=10 seek=10000000
dd if=/dev/zero of=test2 count=10
dd if=/dev/zero of=test3 count=10 seek=10000000
cd /
umount /mnt
dump -f dfile /testd1
mount -o loop /testd2 /mnt
cd /mnt
restore rf /dfile

441
ermt.1.in Normal file
View File

@ -0,0 +1,441 @@
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.TH ERMT 1 "version __VERSION__ of __DATE__" BSD "System management commands"
.SH NAME
ermt \- remote magtape protocol module with transparent encryption support
.SH SYNOPSIS
.B ermt
.SH DESCRIPTION
.B Ermt
is a program used by the remote
.BR dump (8),
.BR restore (8)
.BR cpio (1)
or
.BR tar (1)
programs in manipulating a magnetic tape drive through an interprocess
communication connection.
.B Ermt
is normally started up with an
.BR ssh (1)
.BR rexec (3)
or
.BR rcmd (3)
call.
.PP
The
.B ermt
program accepts requests specific to the manipulation of magnetic tapes,
performs the commands, then responds with a status indication. All responses
are in
.B ASCII
and in one of the following two forms.
.PP
Successful commands have responses of:
.RS
.B A\fInumber\fR\en
.RE
.PP
where
.I number
is an
.B ASCII
representation of a decimal number.
.PP
Unsuccessful commands are responded to with:
.RS
.B E\fIerror-number\fR\en\fIerror-message\fR\en
.RE
.PP
where
.I error-number
is one of the possible error numbers described in
.BR intro (2)
and
.I error-message
is the corresponding error string as printed from a call to
.BR perror (3).
.PP
The protocol is comprised of the following commands, which are sent as
indicated - no spaces are supplied between the command and its arguments, or
between its arguments, and \en indicates that a newline should be supplied:
.TP
.B O\fIdevice\fR\en\fImode\fR\en
Open the specified
.I device
using the indicated
.IR mode .
.I Device
is a full pathname and
.I mode
is an
.B ASCII
representation of a decimal number suitable for passing to
.BR open (2).
If a device had already been opened, it is closed before a new open is
performed.
.TP
.B C\fIdevice\fR\en
Close the currently open device. The
.I device
specified is ignored.
.TP
.B L\fIwhence\fR\en\fIoffset\fR\en
Perform an
.BR lseek (2)
operation using the specified parameters. The response value is that returned
from the
.B lseek
call.
.TP
.B W\fIcount\fR\en
Write data onto the open device.
.B Rmt
reads
.I count
bytes from the connection, aborting if a premature end-of-file is encountered.
The response value is that returned from the
.BR write (2)
call.
.TP
.B R\fIcount\fR\en
Read
.I count
bytes of data from the open device. If
.I count
exceeds the size of the data buffer (10 kilobytes), it is truncated to the
data buffer size.
.B Rmt
then performs the requested
.BR read (2)
and responds with
.B A\fIcount-read\fR\en
if the read was successful; otherwise an error in the standard format is
returned. If the read was successful, the data read is then sent.
.TP
.B I\fIoperation\fR\en\fIcount\fR\en
Perform a
.B MTIOCOP
.BR ioctl (2)
command using the specified parameters. The parameters are interpreted as the
.B ASCII
representations of the decimal values to place in the
.B mt_op
and
.B mt_count
fields of the structure used in the
.B ioctl
call. The return value is the
.I count
parameter when the operation is successful.
.IP
By issuing the
.B I-1\en0\en
command, a client will specify that he is using the VERSION 1 protocol.
.IP
For a VERSION 0 client, the
.I operation
parameter is the platform
.B mt_op
value (could be different if the client and the
.B rmt
server are on two different platforms). For a VERSION 1 client, the
.I operation
parameter is standardized as below:
.RS
.TP
.B 0
Issue a
.B MTWEOF
command (write
.I count
end-of-file records).
.TP
.B 1
Issue a
.B MTFSF
command (forward space over
.I count
file marks).
.TP
.B 2
Issue a
.B MTBSF
command (backward space over
.I count
file marks).
.TP
.B 3
Issue a
.B MTFSR
command (forward space
.I count
inter-record gaps).
.TP
.B 4
Issue a
.B MTBSR
command (backward space
.I count
inter-record gaps).
.TP
.B 5
Issue a
.B MTREW
command (rewind).
.TP
.B 6
Issue a
.B MTOFFL
command (rewind and put the drive offline).
.TP
.B 7
Issue a
.B MTNOP
command (no operation, set status only).
.RE
.TP
.B i\fIoperation\fR\en\fIcount\fR\en
Perform an extended
.B MTIOCOP
.BR ioctl (2)
command using the specified parameters. The parameters are interpreted as the
.B ASCII
representations of the decimal values to place in the
.B mt_op
and
.B mt_count
fields of the structure used in the
.B ioctl
call. The return value is the
.I count
parameter when the operation is successful. The possible operations are:
.RS
.TP
.B 0
Issue a
.B MTCACHE
command (switch cache on).
.TP
.B 1
Issue a
.B MTNOCACHE
command (switch cache off).
.TP
.B 2
Issue a
.B MTRETEN
command (retension the tape).
.TP
.B 3
Issue a
.B MTERASE
command (erase the entire tape).
.TP
.B 4
Issue a
.B MTEOM
command (position to end of media).
.TP
.B 5
Issue a
.B MTNBSF
command (backward space count files to BOF).
.RE
.TP
.B S
Return the status of the open device, as obtained with a
.B MTIOCGET
.B ioctl
call. If the operation was successful, an \*(lqack\*(rq is sent with the size
of the status buffer, then the status buffer is sent (in binary, which is
non-portable between different platforms).
.TP
.BI s sub-command
This is a replacement for the previous
.B S
command, portable across different platforms. If the open device is a magnetic
tape, return members of the magnetic tape status structure, as obtained with a
.B MTIOCGET
ioctl call. If the open device is not a magnetic tape, an error is returned. If
the
.B MTIOCGET
operation was successful, the numerical value of the structure member is
returned in decimal. The following sub commands are supported:
.RS
.TP
.B T
return the content of the structure member
.B mt_type
which contains the type of the magnetic tape device.
.TP
.B D
return the content of the structure member
.B mt_dsreg
which contains the "drive status register".
.TP
.B E
return the content of the structure member
.B mt_erreg
which contains the "error register". This structure member must be retrieved
first because it is cleared after each
.B MTIOCGET
ioctl call.
.TP
.B R
return the content of the structure member
.B mt_resid
which contains the residual count of the last I/O.
.TP
.B F
return the content of the structure member
.B mt_fileno
which contains the file number of the current tape position.
.TP
.B B
return the content of the structure member
.B mt_blkno
which contains the block number of the current tape position.
.TP
.B f
return the content of the structure member
.B mt_flags
which contains MTF_ flags from the driver.
.TP
.B b
return the content of the structure member
.B mt_bf
which contains the optimum blocking factor.
.RE
.PP
Any other command causes
.B rmt
to exit.
.SH ENCRYPTION
This version "rmt" utility - \fBe\fRrmt have a transparent encryption support.
Data is encrypted before it is written to tape, and decrypted when read.
.DQ .DQ .DQ .DQ .DQ .DQ .DQ Tools that use rmt for remote tape access (such as dump, restore, cpio
and tar) can manipulate encrypted data without modification.
.PP
.B ermt
reads the secret key from ".ermt.key" and use
.BR openssl (1)
for perform encryption and decryption.
The symmetric cipher is currently hardwired as Blowfish.
.SH EXAMPLES
.SS Run-time setup:
- Create a user for remote tape access, which we will call "dump":
.TP
useradd -m dump
.TP
- Generate a random key in ~dump/.ermt.key:
.PP
.EX
su - dump
openssl rand -out .ermt.key 32
chmod 400 .ermt.key
.EE
.PP
Due to the way "openssl enc -kfile .ermt.key" reads the key file,
you should ensure that the key contains no \e0 or \er or \en characters,
which would prematurely truncate the key length.
.PP
- Protect the key: copy to many floppies, "od -x .ermt.key|lpr", etc.
.PP
- Set up ssh access from root (or whoever you run dump as)
.PP
- Copy the ermt binary to ~dump and change dump's shell to ~dump/ermt
.PP
.RS
or
.RE
.PP
- If user who run backup program is a same with the user who must to run rmt, just install ermt binary into a bin folder.
.SS Backup usage:
Just dump remotely to localhost:
.PP
.EX
dump -0u -f dump@localhost:/dev/st0 /
restore -i -f dump@localhost:/dev/st0
# You can use GNU tar too
.EE
.PP
If your device is doing hardware compression, it's best to turn
it off, since encrypted data compresses very poorly.
.SS Emergency decrypting:
If you need to restore a tape and
don't have access to a host running ermt,
you have two choices:
.PP
- If you have a copy of the ermt binary, run it with the -d switch
to decrypt stdin to stdout:
.PP
.EX
dd if=/dev/st0 bs=10k |
(cd ~dump; ./ermt -d) | # assuming ermt is in ~dump
restore -i -f -
.EE
.PP
- If not, use the OpenSSL "openssl" command, which does the same thing:
.PP
.EX
dd if=/dev/st0 bs=10k |
openssl enc -d -kfile ~dump/.ermt.key -blowfish -nosalt -nopad |
restore -i -f -
.EE
.PP
.SH ERRORS
If "~/.ermt.key" will not be found, any opertion will fail.
.SH DIAGNOSTICS
All responses are of the form described above.
.SH SEE ALSO
.BR ssh (1),
.BR rcmd (3),
.BR rexec (3),
.I /usr/include/sys/mtio.h,
.BR dump (8),
.BR restore (8)
.SH BUGS
People should be discouraged from using this for a remote file access protocol.
.SH AUTHOR
The
.B dump/restore
backup suit was ported to Linux's Second Extended File System by Remy Card
<card@Linux.EU.Org>. He maintained the initial versions of
.B dump
(up and including 0.4b4, released in january 1997).
.PP
Starting with 0.4b5, the new maintainer is Stelian Pop <stelian@popies.net>.
.SH AVAILABILITY
The
.B dump/restore
backup suit is available from <http://dump.sourceforge.net>
.SH HISTORY
The
.B rmt
command appeared in 4.2BSD.