From beed298687dc709aaf164fae82335ddab0a4a6ecdfbd425666593f418a4fa54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 24 Jul 2017 11:09:49 +0000 Subject: [PATCH 1/2] - Execute tests to ensure the basics are still working OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=58 --- rsync.changes | 5 +++++ rsync.spec | 3 +++ 2 files changed, 8 insertions(+) diff --git a/rsync.changes b/rsync.changes index bf4fbad..d40d3e6 100644 --- a/rsync.changes +++ b/rsync.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 24 11:10:14 UTC 2017 - tchvatal@suse.com + +- Execute tests to ensure the basics are still working + ------------------------------------------------------------------- Mon Jul 24 10:45:16 UTC 2017 - tchvatal@suse.com diff --git a/rsync.spec b/rsync.spec index cc0c0a7..e747fef 100644 --- a/rsync.spec +++ b/rsync.spec @@ -88,6 +88,9 @@ export LDFLAGS="-Wl,-z,relro,-z,now -pie" make %{?_smp_mflags} reconfigure make %{?_smp_mflags} +%check +make %{?_smp_mflags} check + %install %make_install rm -f %{buildroot}%{_sbindir}/rsyncd From 89aa0785d42b935cafc8e2798ae6a8dba4098c0083a3b5f1b682614e53cea24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 25 Jul 2017 11:55:46 +0000 Subject: [PATCH 2/2] - Try more in supporting all scenarios bsc#1046197#c24 * rsync-both-compressions.patch OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=59 --- rsync-both-compressions.patch | 87 +++++++++-------------------------- rsync.changes | 6 +++ rsync.spec | 4 +- 3 files changed, 29 insertions(+), 68 deletions(-) diff --git a/rsync-both-compressions.patch b/rsync-both-compressions.patch index 7aacf66..720a635 100644 --- a/rsync-both-compressions.patch +++ b/rsync-both-compressions.patch @@ -1,8 +1,8 @@ diff --git a/configure.ac b/configure.ac -index e01e124b..5a0b9bca 100644 +index e01e124b..4ee4083e 100644 --- a/configure.ac +++ b/configure.ac -@@ -794,26 +794,23 @@ else +@@ -794,7 +794,8 @@ else AC_MSG_RESULT(no) fi @@ -12,27 +12,14 @@ index e01e124b..5a0b9bca 100644 if test x"$with_included_zlib" != x"no"; then with_included_zlib=yes elif test x"$ac_cv_header_zlib_h" != x"yes"; then - with_included_zlib=yes - fi --if test x"$with_included_zlib" != x"yes"; then -- AC_CHECK_LIB(z, deflateParams, , [with_included_zlib=yes]) --fi - - AC_MSG_CHECKING([whether to use included zlib]) - if test x"$with_included_zlib" = x"yes"; then - AC_MSG_RESULT($srcdir/zlib) +@@ -810,7 +811,6 @@ if test x"$with_included_zlib" = x"yes"; then BUILD_ZLIB='$(zlib_OBJS)' CFLAGS="-I$srcdir/zlib $CFLAGS" --else + else - AC_DEFINE(EXTERNAL_ZLIB, 1, [Define to 1 if using external zlib]) -- AC_MSG_RESULT(no) + AC_MSG_RESULT(no) fi -+AC_CHECK_LIB(z, deflateParams, , [AC_MSG_ERROR([zlib with deflateParams not found])]) -+ - AC_CACHE_CHECK([for unsigned char],rsync_cv_SIGNED_CHAR_OK,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char *s = ""]])],[rsync_cv_SIGNED_CHAR_OK=yes],[rsync_cv_SIGNED_CHAR_OK=no])]) - if test x"$rsync_cv_SIGNED_CHAR_OK" = x"yes"; then diff --git a/options.c b/options.c index 64ec8b84..522875c5 100644 --- a/options.c @@ -55,19 +42,21 @@ index 64ec8b84..522875c5 100644 #ifdef HAVE_SETVBUF diff --git a/token.c b/token.c -index ad9b9bcd..a1ceb975 100644 +index ad9b9bcd..34bc331f 100644 --- a/token.c +++ b/token.c -@@ -374,7 +374,7 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset, - } - if (nb == 0 && token != -2) - flush = Z_SYNC_FLUSH; -- r = deflate(&tx_strm, flush); -+ r = deflate_int(&tx_strm, flush); - if (r != Z_OK) { - rprintf(FERROR, "deflate returned %d\n", r); - exit_cleanup(RERR_STREAMIO); -@@ -405,7 +405,6 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset, +@@ -23,6 +23,10 @@ + #include "itypes.h" + #include + ++#ifndef Z_INSERT_ONLY ++#define Z_INSERT_ONLY Z_SYNC_FLUSH ++#endif ++ + extern int do_compression; + extern int protocol_version; + extern int module_id; +@@ -405,7 +409,6 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset, } else if (token != -2 && do_compression == 1) { /* Add the data in the current block to the compressor's * history and hash table. */ @@ -75,15 +64,7 @@ index ad9b9bcd..a1ceb975 100644 do { /* Break up long sections in the same way that * see_deflate_token() does. */ -@@ -417,18 +416,13 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset, - offset += n1; - tx_strm.next_out = (Bytef *) obuf; - tx_strm.avail_out = AVAIL_OUT_SIZE(CHUNK_SIZE); -- r = deflate(&tx_strm, Z_INSERT_ONLY); -+ r = deflate_int(&tx_strm, Z_INSERT_ONLY); - if (r != Z_OK || tx_strm.avail_in != 0) { - rprintf(FERROR, "deflate on token returned %d (%d bytes left)\n", - r, tx_strm.avail_in); +@@ -424,11 +427,6 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset, exit_cleanup(RERR_STREAMIO); } } while (toklen > 0); @@ -95,7 +76,7 @@ index ad9b9bcd..a1ceb975 100644 } } -@@ -579,7 +573,6 @@ static int32 recv_deflated_token(int f, char **data) +@@ -579,7 +577,6 @@ static int32 recv_deflated_token(int f, char **data) */ static void see_deflate_token(char *buf, int32 len) { @@ -103,7 +84,7 @@ index ad9b9bcd..a1ceb975 100644 int r; int32 blklen; unsigned char hdr[5]; -@@ -617,11 +610,6 @@ static void see_deflate_token(char *buf, int32 len) +@@ -617,11 +614,6 @@ static void see_deflate_token(char *buf, int32 len) exit_cleanup(RERR_STREAMIO); } } while (len || rx_strm.avail_out == 0); @@ -115,29 +96,3 @@ index ad9b9bcd..a1ceb975 100644 } /** -diff --git a/zlib/deflate.c b/zlib/deflate.c -index 529c5e8d..ba711897 100644 ---- a/zlib/deflate.c -+++ b/zlib/deflate.c -@@ -664,7 +664,7 @@ local void flush_pending(strm) - } - - /* ========================================================================= */ --int ZEXPORT deflate (strm, flush) -+int ZEXPORT deflate_int (strm, flush) - z_streamp strm; - int flush; - { -diff --git a/zlib/zlib.h b/zlib/zlib.h -index c4536ca7..ee98c332 100644 ---- a/zlib/zlib.h -+++ b/zlib/zlib.h -@@ -244,7 +244,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - */ - - --ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -+ZEXTERN int ZEXPORT deflate_int OF((z_streamp strm, int flush)); - /* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce diff --git a/rsync.changes b/rsync.changes index d40d3e6..9e07243 100644 --- a/rsync.changes +++ b/rsync.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 25 11:55:53 UTC 2017 - tchvatal@suse.com + +- Try more in supporting all scenarios bsc#1046197#c24 + * rsync-both-compressions.patch + ------------------------------------------------------------------- Mon Jul 24 11:10:14 UTC 2017 - tchvatal@suse.com diff --git a/rsync.spec b/rsync.spec index e747fef..d9284ce 100644 --- a/rsync.spec +++ b/rsync.spec @@ -64,7 +64,7 @@ for backups and mirroring and as an improved copy command for everyday use. %prep %setup -q -b 1 -#rm -f zlib/*.h +rm -f zlib/*.h patch -p1 < patches/acls.diff patch -p1 < patches/xattrs.diff patch -p1 < patches/slp.diff @@ -80,7 +80,7 @@ export CFLAGS="%{optflags} -fPIC -DPIC -fPIE" export LDFLAGS="-Wl,-z,relro,-z,now -pie" %configure \ --with-included-popt=no \ - --with-included-zlib=yes \ + --with-included-zlib=no \ --disable-debug \ --enable-slp \ --enable-acl-support \