[packages/dump] - up to 0.4b46; add openssl patch

arekm arekm at pld-linux.org
Thu Sep 20 12:21:53 CEST 2018


commit bc30bcb371e5a024ddac4c65b9c6fdc09c22ffe5
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Sep 20 12:21:46 2018 +0200

    - up to 0.4b46; add openssl patch

 dump-as_needed-fix.patch |  32 -----------
 dump-autoconf.patch      | 141 -----------------------------------------------
 dump-llh.patch           |  11 ----
 dump.spec                |  20 +++----
 openssl.patch            |  82 +++++++++++++++++++++++++++
 5 files changed, 92 insertions(+), 194 deletions(-)
---
diff --git a/dump.spec b/dump.spec
index 25ce1fd..85a008d 100644
--- a/dump.spec
+++ b/dump.spec
@@ -8,21 +8,21 @@ Summary(ru.UTF-8):	Программы для резервного копиров
 Summary(tr.UTF-8):	dump/restore yedekleme sistemi
 Summary(uk.UTF-8):	Програми для резервного копіювання та відновлення файлових систем
 Name:		dump
-Version:	0.4b44
-Release:	4
+Version:	0.4b46
+Release:	1
 License:	BSD
 Group:		Applications/System
 Source0:	http://downloads.sourceforge.net/dump/%{name}-%{version}.tar.gz
-# Source0-md5:	daec97b1ad905c904eba926221f4be6d
-Patch0:		%{name}-autoconf.patch
-Patch1:		%{name}-llh.patch
-Patch2:		%{name}-as_needed-fix.patch
+# Source0-md5:	4c463f797e7e8a1112fabf5cbf8e1855
+Patch0:		openssl.patch
 URL:		http://dump.sourceforge.net/
 BuildRequires:	autoconf >= 2.57
 BuildRequires:	automake
 BuildRequires:	bzip2-devel
 BuildRequires:	e2fsprogs-devel
 BuildRequires:	libselinux-devel
+BuildRequires:	lzo-devel
+BuildRequires:	sqlite3-devel
 BuildRequires:	ncurses-devel >= 5.2
 BuildRequires:	openssl-devel >= 0.9.7a
 BuildRequires:	pkgconfig
@@ -154,12 +154,11 @@ ermt to wersja programu rmt z szyfrowaniem.
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
 
 %build
 %{__aclocal}
 %{__autoconf}
+%{__automake}
 MYNAME=`id -ru`
 MYGRP=`id -rg`
 %configure \
@@ -173,7 +172,8 @@ MYGRP=`id -rg`
 	--with-binmode=755 \
 	--with-manowner=$MYNAME \
 	--with-mangrp=$MYGRP \
-	--with-manmode=644
+	--with-manmode=644 \
+	--disable-silent-rules
 %{__make}
 
 %install
@@ -194,7 +194,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc COPYRIGHT KNOWNBUGS README THANKS TODO CHANGES
+%doc KNOWNBUGS MAINTAINERS NEWS README TODO 
 %attr(664,root,disk) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/dumpdates
 %attr(755,root,root) %{_sbindir}/dump
 %attr(755,root,root) %{_sbindir}/rdump
diff --git a/dump-as_needed-fix.patch b/dump-as_needed-fix.patch
deleted file mode 100644
index 5f49af1..0000000
--- a/dump-as_needed-fix.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- dump-0.4b43/configure.in.orig	2011-02-03 19:33:01.000000000 +0100
-+++ dump-0.4b43/configure.in	2011-02-03 19:37:25.852692227 +0100
-@@ -407,9 +407,9 @@
- dnl Check for Ext2fs headers and libraries
- dnl
- AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no], [-])
--PKG_CHECK_MODULES(EXT2FS, [ext2fs])
-+PKG_CHECK_MODULES(EXT2FS, [ext2fs com_err])
- if test -n "$STATIC" ; then
--	EXT2FS_LIBS=`$PKG_CONFIG --libs --static ext2fs`
-+	EXT2FS_LIBS=`$PKG_CONFIG --libs --static ext2fs com_err`
- fi
- if test "$ext2fs_h" = no -o "x$EXT2FS_LIBS" = "x"; then
- 	AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
-@@ -510,7 +510,7 @@
- dnl
- dnl Check for rl_completion_matches
- dnl
--AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap")
-+AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "$rdllib")
- if test "$rlcm" = yes; then
- 	AC_DEFINE([HAVE_READLINE_RLCM],1,[Define this if your readline libs have the rl_completion_matches library.])
- fi
-@@ -518,7 +518,7 @@
- dnl
- dnl Check for rl_completion_append_character
- dnl
--AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap")
-+AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "$rdllib")
- if test "$rcac" = yes; then
- 	AC_DEFINE([HAVE_READLINE_CAC],1,[Define this if your readline libs have the rl_completion_append_character variable.])
- fi
diff --git a/dump-autoconf.patch b/dump-autoconf.patch
deleted file mode 100644
index 57cf158..0000000
--- a/dump-autoconf.patch
+++ /dev/null
@@ -1,141 +0,0 @@
---- dump-0.4b33/dump/Makefile.in.orig	Tue Feb 11 23:18:12 2003
-+++ dump-0.4b33/dump/Makefile.in	Tue Feb 11 23:19:54 2003
-@@ -13,12 +13,10 @@
- 
- PROG=		dump
- RPROG=		rdump
--LINKS=		${SBINDIR}/dump ${SBINDIR}/rdump
- SRCS=		itime.c main.c optr.c tape.c traverse.c unctime.c
- OBJS=		itime.o main.o optr.o tape.o traverse.o unctime.o \
- 		../common/dumprmt.o
--MAN8=		dump.8
--RMAN8=		rdump.8
-+MAN8=		dump.8 rdump.8
- 
- all::		$(PROG) $(MAN8)
- 
-@@ -31,11 +29,11 @@
- 	    -e "s|__VERSION__|$(VERSION)|g" $< > $@
- 
- install::	all
--	$(INSTALL) -d $(SBINDIR) $(MANDIR)
--	$(INSTALLBIN) $(PROG) $(SBINDIR)
--	$(INSTALLMAN) $(MAN8) $(MANDIR)
--	cd $(SBINDIR) && $(RM) -f $(RPROG) && $(LN_S) $(PROG) $(RPROG)
--	cd $(MANDIR) && $(RM) -f $(RMAN8) && $(LN_S) $(MAN8) $(RMAN8)
-+	$(INSTALL) -d $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)
-+	$(INSTALLBIN) $(PROG) $(DESTDIR)$(sbindir)
-+	$(LN_S) dump $(DESTDIR)$(sbindir)/rdump
-+	$(INSTALLMAN) $(MAN8) $(DESTDIR)$(mandir)
-+
- 
- clean::
- 	$(RM) -f $(PROG) $(MAN8) \#* *.s *.o *.a *~ core
---- dump-0.4b33/rmt/Makefile.in.orig	Tue Feb 11 23:22:03 2003
-+++ dump-0.4b33/rmt/Makefile.in	Tue Feb 11 23:23:07 2003
-@@ -3,6 +3,8 @@
- top_srcdir=	@top_srcdir@
- srcdir=		@srcdir@
- top_builddir=	..
-+sbindir=	@sbindir@
-+mandir=		@mandir@
- 
- @MCONFIG@
- 
-@@ -26,9 +28,10 @@
- 	    -e "s|__VERSION__|$(VERSION)|g" $< > $@
- 
- install::	all
--	$(INSTALL) -d $(SBINDIR) $(MANDIR)
--	$(INSTALLBIN) $(PROG) $(SBINDIR)
--	$(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR)
-+	$(INSTALL) -d $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)
-+	$(INSTALLBIN) $(PROG) $(DESTDIR)$(sbindir)
-+	$(INSTALLMAN) $(MAN8) $(DESTDIR)$(mandir)
-+	
- 
- clean::
- 	rm -f $(PROG) \#* *.s *.o *.a *~ core rmt.8
---- dump-0.4b33/MCONFIG.in.orig	Tue Feb 11 23:11:18 2003
-+++ dump-0.4b33/MCONFIG.in	Tue Feb 11 23:11:43 2003
-@@ -22,8 +22,8 @@
- 
- prefix=		@prefix@
- exec_prefix=	@exec_prefix@
--SBINDIR=	@sbindir@
--MANDIR=		@mandir@/man8
-+sbindir=	@sbindir@
-+mandir=		@mandir@/man8
- 
- DUMPDATESPATH=	@DUMPDATESPATH@
- #
---- dump-0.4b33/Makefile.in.orig	Tue Feb 11 23:14:05 2003
-+++ dump-0.4b33/Makefile.in	Tue Feb 11 23:14:42 2003
-@@ -9,7 +9,7 @@
- 
- all clean install dep depend realclean distclean::
- 	for i in $(SUBDIRS); do \
--		(cd $$i && $(MAKE) $@) || exit 1; \
-+		(cd $$i && $(MAKE) DESTDIR=$(DESTDIR) $@) || exit 1; \
- 	done
- 
- distclean::
---- dump-0.4b35/configure.in.orig	2003-04-10 08:25:21.000000000 +0000
-+++ dump-0.4b35/configure.in	2003-11-23 12:46:11.000000000 +0000
-@@ -498,12 +498,6 @@
- AC_CHECK_TYPE(u_quad_t, uint64_t)
- 
- dnl
--dnl Compute top_buildir
--dnl
--top_builddir=`cd .; pwd`
--AC_SUBST(top_builddir)
--
--dnl
- dnl Create directories
- dnl
- test -d compat || mkdir compat
-@@ -512,4 +507,5 @@
- dnl
- dnl Output files
- dnl
--AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)
-+AC_CONFIG_FILES([MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE])
-+AC_OUTPUT
---- dump-0.4b33.orig/restore/rrestore.8 Thu Jan  1 01:00:00 1970
-+++ dump-0.4b33/restore/rrestore.8      Mon Nov 18 15:51:55 2002
-@@ -0,0 +1 @@
-+.so restore.8
---- dump-0.4b32.orig/dump/rdump.8       Thu Jan  1 01:00:00 1970
-+++ dump-0.4b32/dump/rdump.8    Mon Nov 18 15:51:55 2002
-@@ -0,0 +1 @@
-+.so dump.8
---- dump-0.4b40/restore/Makefile.in.orig	2005-05-02 17:10:46.000000000 +0200
-+++ dump-0.4b40/restore/Makefile.in	2005-06-14 17:33:13.056818552 +0200
-@@ -19,8 +19,7 @@
- 		utilities.c xattr.c
- OBJS=		dirs.o interactive.o main.o restore.o symtab.o tape.o \
- 		utilities.o xattr.o ../common/dumprmt.o
--MAN8=		restore.8
--RMAN8=		rrestore.8
-+MAN8=		restore.8 rrestore.8
- 
- .c.o:
- 	$(CC) -c $(ALL_CFLAGS) $< -o $@
-@@ -35,11 +34,11 @@
- 	    -e "s|__VERSION__|$(VERSION)|g" $< > $@
- 
- install::	all
--	$(INSTALL) -d $(SBINDIR) $(MANDIR)
--	$(INSTALLBIN) $(PROG) $(SBINDIR)
--	$(INSTALLMAN) $(MAN8) $(MANDIR)
--	cd $(SBINDIR) && $(RM) -f $(RPROG) && $(LN_S) $(PROG) $(RPROG)
--	cd $(MANDIR) && $(RM) -f $(RMAN8) && $(LN_S) $(MAN8) $(RMAN8)
-+	$(INSTALL) -d $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)
-+	$(INSTALLBIN) $(PROG) $(DESTDIR)$(sbindir)
-+	$(LN_S) restore $(DESTDIR)$(sbindir)/rrestore
-+	$(INSTALLMAN) $(MAN8) $(DESTDIR)$(mandir)
-+
- 
- clean::
- 	$(RM) -f $(PROG) $(MAN8) \#* *.s *.o *.a *~ core
diff --git a/dump-llh.patch b/dump-llh.patch
deleted file mode 100644
index b439942..0000000
--- a/dump-llh.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- dump-0.4b36/dump/main.c.orig	2004-04-21 10:55:51.000000000 +0200
-+++ dump-0.4b36/dump/main.c	2004-06-19 00:32:33.747372855 +0200
-@@ -66,6 +66,8 @@
- #include <ext2fs/ext2fs.h>
- #include <sys/stat.h>
- #include <bsdcompat.h>
-+/* <linux/audit.h> includes <asm/types.h> which conflict with <ext2fs/ext2_fs.h> on some archs */
-+#define _LINUX_AUDIT_H_
- #include <linux/fs.h>	/* for definition of BLKFLSBUF */
- #elif defined sunos
- #include <sys/vnode.h>
diff --git a/openssl.patch b/openssl.patch
new file mode 100644
index 0000000..dff5b4c
--- /dev/null
+++ b/openssl.patch
@@ -0,0 +1,82 @@
+diff -urN dump-0.4b46.org/common/transformation_ssl.c dump-0.4b46/common/transformation_ssl.c
+--- dump-0.4b46.org/common/transformation_ssl.c	2016-06-08 07:01:45.000000000 +0200
++++ dump-0.4b46/common/transformation_ssl.c	2018-09-20 12:09:51.499235266 +0200
+@@ -515,7 +515,7 @@
+ 		//EVP_CIPHER_CTX_rand_key(ctx, t->state.ssl.key);
+ 		//EVP_CIPHER_CTX_cleanup(ctx);
+ 		//EVP_CIPHER_CTX_free(ctx);
+-		RAND_bytes(t->state.ssl.key, t->state.ssl.cipher->key_len);
++		RAND_bytes(t->state.ssl.key, EVP_CIPHER_key_length(t->state.ssl.cipher));
+ 	} else {
+ 		// how do we get keys?
+ 	}
+diff -urN dump-0.4b46.org/rmt/cipher.c dump-0.4b46/rmt/cipher.c
+--- dump-0.4b46.org/rmt/cipher.c	2016-06-07 20:09:12.000000000 +0200
++++ dump-0.4b46/rmt/cipher.c	2018-09-20 12:17:23.936324758 +0200
+@@ -23,7 +23,7 @@
+ char *
+ cipher(char *buf, int buflen, int do_encrypt)
+ {
+-	static EVP_CIPHER_CTX ctx;
++	static EVP_CIPHER_CTX *ctx;
+ 	static char *out = NULL;	/* return value, grown as necessary */
+ 	static int outlen = 0;
+ 	static int init = 0, which, blocksize;
+@@ -71,41 +71,52 @@
+ 		}
+ 		EVP_BytesToKey(cipher, EVP_md5(), NULL,
+ 			buf, strlen(buf), 1, key, iv);
+-		EVP_CIPHER_CTX_init(&ctx);
+-		EVP_CipherInit_ex(&ctx, cipher, NULL, key, iv, do_encrypt);
+-		EVP_CIPHER_CTX_set_padding(&ctx, 0);	// -nopad
++		ctx = EVP_CIPHER_CTX_new();
++		if (ctx == NULL) {
++			 syslog(LOG_ERR, "Failed to allocate crypto context");
++			 errno = EINVAL;
++			 return NULL;
++		}
++		EVP_CIPHER_CTX_init(ctx);
++		EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, do_encrypt);
++		EVP_CIPHER_CTX_set_padding(ctx, 0);	// -nopad
+ 		OPENSSL_cleanse(buf, sizeof buf);
+ 		OPENSSL_cleanse(key, sizeof key);
+ 		OPENSSL_cleanse(iv, sizeof iv);
+-		blocksize = EVP_CIPHER_CTX_block_size(&ctx);
++		blocksize = EVP_CIPHER_CTX_block_size(ctx);
+ 		which = do_encrypt;
+ 		init = 1;
+ 	}
+ 	if (which != do_encrypt) {
+ 		syslog(LOG_ERR, "Cannot switch modes");
+ 		errno = EINVAL;
++		EVP_CIPHER_CTX_free(ctx);
+ 		return NULL;
+ 	}
+ 	if ((buflen % blocksize) != 0) {
+ 		syslog(LOG_ERR, "Buffer size is not a multiple of cipher block size");
+ 		errno = EINVAL;
++		EVP_CIPHER_CTX_free(ctx);
+ 		return NULL;
+ 	}
+ 	if (outlen < buflen+blocksize) {
+ 		outlen = (buflen+blocksize) * 2;
+ 		out = realloc(out, outlen);
+ 	}
+-	if (!EVP_CipherUpdate(&ctx, out, &n, buf, buflen)) {
++	if (!EVP_CipherUpdate(ctx, out, &n, buf, buflen)) {
+ 		syslog(LOG_ERR, "EVP_CipherUpdate failed");
+ 		errno = EINVAL;
++		EVP_CIPHER_CTX_free(ctx);
+ 		return NULL;
+ 	}
+ 	if (n != buflen) {
+ 		syslog(LOG_ERR, "EVP_CipherUpdate: %d != %d", n, buflen);
+ 		errno = EINVAL;
++		EVP_CIPHER_CTX_free(ctx);
+ 		return NULL;
+ 	}
+ 	// assert(ctx->buf_len == 0);
++	EVP_CIPHER_CTX_free(ctx);
+ 	return out;
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dump.git/commitdiff/bc30bcb371e5a024ddac4c65b9c6fdc09c22ffe5



More information about the pld-cvs-commit mailing list