Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rsync.17217 for 
openSUSE:Leap:15.2:Update checked in at 2021-12-06 14:06:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/rsync.17217 (Old)
 and      /work/SRC/openSUSE:Leap:15.2:Update/.rsync.17217.new.31177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rsync.17217"

Mon Dec  6 14:06:54 2021 rev:1 rq:935139 version:3.1.3

Changes:
--------
New Changes file:

--- /dev/null   2021-11-19 12:07:02.652419071 +0100
+++ /work/SRC/openSUSE:Leap:15.2:Update/.rsync.17217.new.31177/rsync.changes    
2021-12-06 14:06:55.321418737 +0100
@@ -0,0 +1,986 @@
+-------------------------------------------------------------------
+Tue Nov 16 14:49:10 UTC 2021 - Pedro Monreal <[email protected]>
+
+- Fixed an error when using the external compression library
+  where files larger that 1GB would not be transferred completely
+  and failing with error:
+    - deflate on token returned 0 (XXX bytes left)
+    - rsync error: error in rsync protocol data stream (code 12)
+  * Add rsync-fix-external-compression.patch [bsc#1190828]
+
+-------------------------------------------------------------------
+Thu Sep 16 17:17:40 UTC 2021 - Pedro Monreal <[email protected]>
+
+- Fix a segmentation fault in iconv [bsc#1188258]
+  * Add rsync-iconv-segfault.patch
+
+-------------------------------------------------------------------
+Mon Apr 15 16:49:02 UTC 2019 - Pedro Monreal Gonzalez 
<[email protected]>
+
+- Fixed bug numbers in spec file
+
+-------------------------------------------------------------------
+Sat Apr 13 09:49:56 UTC 2019 - Matwey V. Kornilov <[email protected]>
+
+- Add patch: rsync-fix-prealloc-to-keep-file-size-0-when-possible.patch 
(boo#1108562)
+
+-------------------------------------------------------------------
+Wed Jul 11 15:02:34 CEST 2018 - [email protected]
+
+- Don't require systemd explicit, spec file can handle both cases
+  correct and in containers we don't have systemd [bsc#1100786].
+
+-------------------------------------------------------------------
+Tue Apr  3 15:01:42 CEST 2018 - [email protected]
+
+- Use %license instead of %doc [bsc#1082318]
+
+-------------------------------------------------------------------
+Mon Jan 29 11:03:42 UTC 2018 - [email protected]
+
+- Update to version 3.1.3 [bsc#1076503]:
+  Protocol: 31 (unchanged)
+
+- SECURITY FIXES:
+  * Fixed a buffer overrun in the protocol's handling of xattr names and
+    ensure that the received name is null terminated.
+  * Fix an issue with --protect-args where the user could specify the arg
+    in the protected-arg list and short-circuit some of the arg-sanitizing
+    code.
+
+- BUG FIXES:
+  * Don't output about a new backup dir without appropriate info verbosity.
+  * Fixed some issues with the sort functions in support/rsyncstats script.
+  * Added a way to specify daemon config lists (e.g. users, groups, etc)
+  * that contain spaces (see "auth users" in the latest rsyncd.conf manpage).
+  * If a backup fails (e.g. full disk) rsync exits with an error.
+  * Fixed a problem with a doubled --fuzzy option combined with --link-dest.
+  * Avoid invalid output in the summary if either the start or end time had
+    an error.
+  * We don't allow a popt alias to affect the --daemon or --server options.
+  * Fix daemon exclude code to disallow attribute changes in addition to
+    disallowing transfers.
+  * Don't force nanoseconds to match if a non-transferred, non-checksummed
+    file only passed the quick-check w/o comparing nanosecods.
+
+- ENHANCEMENTS:
+  * Added the ability for rsync to compare nanosecond times in its
+    file-check
+    comparisons, and added support nanosecond times on Mac OS X.
+  * Added a short-option (-@) for --modify-window.
+  * Added the --checksum-choice=NAME[,NAME] option to choose the checksum
+    algorithms.
+  * Added hashing of xattr names (with using -X) to improve the handling of
+    files with large numbers of xattrs.
+  * Added a way to filter xattr names using include/exclude/filter rules
+    (see the --xattrs option in the manpage for details).
+  * Added "daemon chroot|uid|gid" to the daemon config (in addition to the
+    old chroot|uid|gid settings that affect the daemon's transfer process).
+  * Added "syslog tag" to the daemon configuration.
+  * Some manpage improvements.
+
+- DEVELOPER RELATED:
+  * Tweak the "make" output when yodl isn't around to create the man pages.
+  * Changed an obsolete autoconf compile macro.
+  * Support newer yodl versions when converting man pages.
+
+- Dropped patches fixed upstream:
+  * rsync-CVE-2017-16548.patch
+  * rsync-3.1.2-CVE-2018-5764.patch
+
+- Refreshed patches:
+  * rsync-send_error_to_sender.patch
+
+-------------------------------------------------------------------
+Thu Jan 18 12:13:48 UTC 2018 - [email protected]
+
+- Security fix: Ignore --protect-args when already sent by client
+  [bsc#1076503, CVE-2018-5764]
+  * Added patch rsync-3.1.2-CVE-2018-5764.patch
+
+-------------------------------------------------------------------
+Tue Jan  9 17:07:12 UTC 2018 - [email protected]
+
+- Fix: Stop file upload after errors [bsc#1062063]
+- Added patches:
+  * rsync-send_error_to_sender.patch
+  * rsync-avoid-uploading-after-error.patch
+
+-------------------------------------------------------------------
+Tue Nov 28 16:18:45 UTC 2017 - [email protected]
+
+- Security fix [bsc#1066644, CVE-2017-16548]
+  * Missing trailing '\0' character check could lead to remote DoS
+  * Added rsync-CVE-2017-16548.patch
+
+-------------------------------------------------------------------
+Tue Jul 25 11:55:53 UTC 2017 - [email protected]
+
+- Try more in supporting all scenarios bsc#1046197#c24
+  * rsync-both-compressions.patch
+
+-------------------------------------------------------------------
+Mon Jul 24 11:10:14 UTC 2017 - [email protected]
+
+- Execute tests to ensure the basics are still working
+
+-------------------------------------------------------------------
+Mon Jul 24 10:45:16 UTC 2017 - [email protected]
+
+- Refresh patch rsync-both-compressions.patch to include
+  fix when using old-compress on new zlib on server too
+
+-------------------------------------------------------------------
+Thu Jul 13 09:00:59 UTC 2017 - [email protected]
+
+- Add patch to build with both bundled and external zlib to support
+  both compression methods at once bsc#1046197:
+  * rsync-both-compressions.patch
+
+-------------------------------------------------------------------
+Wed Jun 14 12:21:21 UTC 2017 - [email protected]
+
+- We no longer need to inject the pid in post as we do not use
+  the iniscript relying on it
+- Add socket activation service instead of the xinetd service
+- Verify in services the configuration to run actually exist
+- Drop sle11 support as it does not autoreconf anymore
+- Drop patch system-zlib.diff that was never applied
+- Switch to system popt and zlib:
+  * This should not cause issues now because upstream states the
+    underlying issue why we used the bundled one was fixed by
+    using more safeguarded error detection
+
+-------------------------------------------------------------------
+Wed Jan  6 10:26:26 UTC 2016 - [email protected]
+
+- update to 3.1.2
+- drop patches rsync-CVE-2014-9512.patch,
+  rsync-equivalent_of_CVE-2014-8242.patch (applied upstream)
+
+-------------------------------------------------------------------
+Wed Oct  7 12:26:26 UTC 2015 - [email protected]
+
+- better disable slp by default, it doesn't seem to be used much
+  and it often caused problems (eg boo#898513, bsc#922710)
+  * set "use slp" in rsyncd.conf to enable
+  * modified rsync-add_back_use_slp_directive.patch
+
+-------------------------------------------------------------------
+Tue Oct  6 11:16:55 UTC 2015 - [email protected]
+
+- add a compatibility flag to avoid checksum collisions (bsc#900914)
+  * fixes rsync equivalent of librsync's CVE-2014-8242
+  * added rsync-equivalent_of_CVE-2014-8242.patch
+- modify rsync-add_back_use_slp_directive.patch
+
+-------------------------------------------------------------------
+Tue Aug 11 09:40:36 UTC 2015 - [email protected]
+
+- reintroduce "use slp" directive (bsc#922710)
+  * added rsync-add_back_use_slp_directive.patch
+
+-------------------------------------------------------------------
+Wed Feb 25 02:23:49 UTC 2015 - [email protected]
+
+- rsync-no-libattr.patch: Use AC_SEARCH_LIBS([getxattr], [attr])
+  instead of AC_CHECK_LIB(attr,getxattr) so libattr is 
+  not injected as a dependency when glibc is enough since
+  several years to use getxattr.
+
+-------------------------------------------------------------------
+Mon Feb  2 18:42:25 UTC 2015 - [email protected]
+
+- fix for CVE-2014-9512 (bnc#915410)
+  * path spoofing attack vulnerability
+  * added rsync-CVE-2014-9512.patch
+
++++ 789 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:Leap:15.2:Update/.rsync.17217.new.31177/rsync.changes

New:
----
  logrotate.rsync
  rsync-3.1.3.tar.gz
  rsync-3.1.3.tar.gz.asc
  rsync-add_back_use_slp_directive.patch
  rsync-avoid-uploading-after-error.patch
  rsync-both-compressions.patch
  rsync-fix-external-compression.patch
  rsync-fix-prealloc-to-keep-file-size-0-when-possible.patch
  rsync-iconv-segfault.patch
  rsync-no-libattr.patch
  rsync-patches-3.1.3.tar.gz
  rsync-patches-3.1.3.tar.gz.asc
  rsync-send_error_to_sender.patch
  rsync-server.firewall
  rsync.changes
  rsync.keyring
  rsync.spec
  rsyncd.conf
  rsyncd.rc
  rsyncd.secrets
  rsyncd.service
  rsyncd.socket
  [email protected]

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rsync.spec ++++++
#
# spec file for package rsync
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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:           rsync
Version:        3.1.3
Release:        0
Summary:        Versatile tool for fast incremental file transfer
License:        GPL-3.0-or-later
Group:          Productivity/Networking/Other
Url:            http://rsync.samba.org/
Source:         http://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz
Source1:        
http://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz
Source2:        logrotate.rsync
Source3:        rsyncd.socket
Source4:        rsyncd.rc
Source5:        rsyncd.conf
Source6:        rsyncd.secrets
Source7:        rsync-server.firewall
Source8:        rsyncd.service
Source9:        [email protected]
Source10:       http://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz.asc
Source11:       
http://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz.asc
Source12:       %{name}.keyring
Patch0:         rsync-no-libattr.patch
#PATCH-FIX-SUSE boo#922710 slp
Patch1:         rsync-add_back_use_slp_directive.patch
Patch2:         rsync-both-compressions.patch
#PATCH-FIX-UPSTREAM bsc#1062063 rsync doesn't stop on errors
Patch4:         rsync-send_error_to_sender.patch
Patch5:         rsync-avoid-uploading-after-error.patch
#PATCH-FIX-UPSTREAM bsc#1108562 file contents cause rsync to fail
Patch6:         rsync-fix-prealloc-to-keep-file-size-0-when-possible.patch
#PATCH-FIX-UPSTREAM bsc#1188258 Fix iconv crash
Patch7:         rsync-iconv-segfault.patch
#PATCH-FIX-SUSE bsc#1190828 Fix external compression
Patch8:         rsync-fix-external-compression.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libacl-devel
BuildRequires:  openslp-devel
BuildRequires:  popt-devel
BuildRequires:  systemd-rpm-macros
BuildRequires:  zlib-devel
Requires(post): grep
Requires(post): sed
Recommends:     logrotate

%description
Rsync is a fast and extraordinarily versatile file  copying  tool. It can copy
locally, to/from another host over any remote shell, or to/from a remote rsync
daemon. It offers a large number of options that control every aspect of its
behavior and permit very flexible specification of the set of files to be
copied. It is famous for its delta-transfer algorithm, which reduces the amount
of data sent over the network by sending only the differences between the
source files and the existing files in the destination. Rsync is widely used
for backups and mirroring and as an improved copy command for everyday use.

%prep
%setup -q -b 1
rm -f zlib/*.h
patch -p1 < patches/acls.diff
patch -p1 < patches/xattrs.diff
patch -p1 < patches/slp.diff
%patch1 -p1
# fate#312479
patch -p1 < patches/time-limit.diff
%patch0 -p1
%patch2 -p1
%patch4
%patch5
%patch6 -p1
%patch7 -p1
%patch8 -p1

%build
autoreconf -fiv
export CFLAGS="%{optflags} -fPIC -DPIC -fPIE"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
%configure \
  --with-included-popt=no \
  --with-included-zlib=no \
  --disable-debug \
  --enable-slp \
  --enable-acl-support \
  --enable-xattr-support
make %{?_smp_mflags} reconfigure
make %{?_smp_mflags}

%check
make %{?_smp_mflags} check

%install
%make_install
rm -f %{buildroot}%{_sbindir}/rsyncd
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}%{_sysconfdir}/init.d
install -d %{buildroot}%{_sysconfdir}/xinetd.d
install -d %{buildroot}%{_prefix}/sbin
ln -sf ../bin/rsync %{buildroot}%{_sbindir}/rsyncd
install -m 755 support/rsyncstats %{buildroot}%{_prefix}/bin
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/rsync
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rsyncd.conf
install -m 600 %{SOURCE6} %{buildroot}%{_sysconfdir}/rsyncd.secrets
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
install -m 644 %{SOURCE7} 
%{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/rsync-server
install -D -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/[email protected]
install -D -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/rsyncd.service
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/rsyncd.socket
ln -sf service %{buildroot}%{_sbindir}/rcrsyncd

%pre
%service_add_pre rsyncd.service

%preun
%service_del_preun rsyncd.service

%post
%service_add_post rsyncd.service

%postun
%service_del_postun rsyncd.service

%files
%{_unitdir}/[email protected]
%{_unitdir}/rsyncd.service
%{_unitdir}/rsyncd.socket
%config(noreplace) %{_sysconfdir}/rsyncd.conf
%config(noreplace) %{_sysconfdir}/rsyncd.secrets
%config(noreplace) %{_sysconfdir}/logrotate.d/rsync
%{_sbindir}/rcrsyncd
%{_sbindir}/rsyncd
%{_bindir}/rsyncstats
%{_bindir}/rsync
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/*
%{_mandir}/man1/rsync.1%{ext_man}
%{_mandir}/man5/rsyncd.conf.5%{ext_man}
%license COPYING
%doc NEWS README tech_report.tex

%changelog
++++++ logrotate.rsync ++++++
/var/log/rsyncd.log {
    compress
    dateext
    maxage 365
    rotate 99
    size=+1024k
    notifempty
    missingok
    copytruncate
}

++++++ rsync-add_back_use_slp_directive.patch ++++++
Index: rsync-3.1.1/clientserver.c
===================================================================
--- rsync-3.1.1.orig/clientserver.c     2015-10-07 14:58:43.767379915 +0200
+++ rsync-3.1.1/clientserver.c  2015-10-07 14:59:24.515920754 +0200
@@ -1200,7 +1200,7 @@ int daemon_main(void)
         * local address??? */
 
 #ifdef HAVE_LIBSLP
-       if (register_services()) {
+       if (lp_use_slp() && register_services()) {
                rprintf(FINFO,
                    "Couldn't register with service discovery protocol, 
continuing anyway\n");
        }
Index: rsync-3.1.1/loadparm.c
===================================================================
--- rsync-3.1.1.orig/loadparm.c 2015-10-07 14:58:43.767379915 +0200
+++ rsync-3.1.1/loadparm.c      2015-10-07 14:59:24.515920754 +0200
@@ -101,6 +101,7 @@ typedef struct {
        int rsync_port;
 #ifdef HAVE_LIBSLP
        int slp_refresh;
+       BOOL use_slp;
 #endif
 } global_vars;
 
@@ -181,6 +182,10 @@ static const all_vars Defaults = {
 
  /* listen_backlog; */         5,
  /* rsync_port; */             0,
+#ifdef HAVE_LIBSLP
+ /* slp_refresh; */            0,
+ /* use_slp; */                        False,
+#endif
  },
 
  /* ==== local_vars ==== */
@@ -322,6 +327,7 @@ static struct parm_struct parm_table[] =
  {"port",              P_INTEGER,P_GLOBAL,&Vars.g.rsync_port,          NULL,0},
 #ifdef HAVE_LIBSLP
  {"slp refresh",       P_INTEGER,P_GLOBAL,&Vars.g.slp_refresh,         NULL,0},
+ {"use slp",           P_BOOL,   P_GLOBAL,&Vars.g.use_slp,             NULL,0},
 #endif
  {"socket options",    P_STRING, P_GLOBAL,&Vars.g.socket_options,      NULL,0},
 
@@ -458,6 +464,7 @@ FN_GLOBAL_INTEGER(lp_listen_backlog, &Va
 FN_GLOBAL_INTEGER(lp_rsync_port, &Vars.g.rsync_port)
 #ifdef HAVE_LIBSLP
 FN_GLOBAL_INTEGER(lp_slp_refresh, &Vars.g.slp_refresh)
+FN_GLOBAL_BOOL(lp_use_slp, &Vars.g.use_slp)
 #endif
 
 FN_LOCAL_STRING(lp_auth_users, auth_users)
Index: rsync-3.1.1/rsyncd.conf.yo
===================================================================
--- rsync-3.1.1.orig/rsyncd.conf.yo     2015-10-07 14:58:43.767379915 +0200
+++ rsync-3.1.1/rsyncd.conf.yo  2015-10-07 14:59:24.516920767 +0200
@@ -124,6 +124,10 @@ via the bf(--sockopts) command-line opti
 dit(bf(listen backlog)) You can override the default backlog value when the
 daemon listens for connections.  It defaults to 5.
 
+dit(bf(use slp)) This parameter is used to determine if the module names are
+advertised via slp.  The default is for this to be disabled, which won't
+advertise your public modules.
+
 dit(bf(slp refresh)) This parameter is used to determine how long service
 advertisements are valid (measured in seconds), and is only applicable if
 you have Service Location Protocol support compiled in. If this is
Index: rsync-3.1.1/socket.c
===================================================================
--- rsync-3.1.1.orig/socket.c   2015-10-07 14:58:43.767379915 +0200
+++ rsync-3.1.1/socket.c        2015-10-07 14:59:24.516920767 +0200
@@ -546,7 +546,7 @@ void start_accept_loop(int port, int (*f
        int *sp, maxfd, i;
 #ifdef HAVE_LIBSLP
        time_t next_slp_refresh;
-       short slp_timeout = lp_slp_refresh();
+       short slp_timeout = lp_use_slp() ? lp_slp_refresh() : 0;
        if (slp_timeout) {
                if (slp_timeout < SLP_MIN_TIMEOUT)
                        slp_timeout = SLP_MIN_TIMEOUT;
Index: rsync-3.1.1/main.c
===================================================================
--- rsync-3.1.1.orig/main.c     2015-10-07 14:58:43.767379915 +0200
+++ rsync-3.1.1/main.c  2015-10-07 14:59:24.516920767 +0200
@@ -1250,11 +1250,14 @@ static int start_client(int argc, char *
                if (shell_machine && !shell_machine[0]) {
 #ifdef HAVE_LIBSLP
                        /* User entered just rsync:// URI */
-                       print_service_list();
-                       exit_cleanup(0);
-#else /* No SLP, die here */
+                       if (lp_use_slp()) {
+                               print_service_list();
+                               exit_cleanup(0);
+                       } else {
+                               rprintf(FINFO, "SLP is disabled, cannot 
browse\n");
+                       }
+#else /* No SLP */
                        rprintf(FINFO, "No SLP support, cannot browse\n");
-                       exit_cleanup(RERR_SYNTAX);
 #endif
                }
 
Index: rsync-3.1.1/rsyncd.conf.5
===================================================================
--- rsync-3.1.1.orig/rsyncd.conf.5      2015-10-07 14:36:06.288364061 +0200
+++ rsync-3.1.1/rsyncd.conf.5   2015-10-07 15:00:28.309767222 +0200
@@ -142,6 +142,11 @@ via the \fB\-\-sockopts\fP command\-line
 You can override the default backlog value when the
 daemon listens for connections.  It defaults to 5.
 .IP 
+.IP "\fBuse slp\fP"
+This parameter is used to determine if the module names are
+advertised via slp.  The default is for this to be disabled, which won't
+advertise your public modules.
+.IP 
 .IP "\fBslp refresh\fP"
 This parameter is used to determine how long service
 advertisements are valid (measured in seconds), and is only applicable if
++++++ rsync-avoid-uploading-after-error.patch ++++++
https://bugzilla.samba.org/show_bug.cgi?id=12525#c1

--- cleanup.c.orig      2017-01-18 14:53:35.000000000 +0100
+++ cleanup.c   2017-01-18 14:56:58.000000000 +0100
@@ -255,7 +255,7 @@
                                }
                                if (!am_sender)
                                        io_flush(MSG_FLUSH); /* Be sure to send 
all messages */
-                               noop_io_until_death();
+                               /* noop_io_until_death(); */
                        }
                        else if (!am_sender)
                                io_flush(MSG_FLUSH); /* Be sure to send all 
messages */
++++++ rsync-both-compressions.patch ++++++
diff --git a/configure.ac b/configure.ac
index e01e124b..4ee4083e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -794,7 +794,8 @@ else
     AC_MSG_RESULT(no)
 fi
 
-# We default to using our zlib unless --with-included-zlib=no is given.
+# Always compile with system zlib but if --with-included-zlib=yes is given
+# or not specified at all compile in the support too.
 if test x"$with_included_zlib" != x"no"; then
     with_included_zlib=yes
 elif test x"$ac_cv_header_zlib_h" != x"yes"; then
@@ -810,7 +811,6 @@ if test x"$with_included_zlib" = x"yes"; then
     BUILD_ZLIB='$(zlib_OBJS)'
     CFLAGS="-I$srcdir/zlib $CFLAGS"
 else
-    AC_DEFINE(EXTERNAL_ZLIB, 1, [Define to 1 if using external zlib])
     AC_MSG_RESULT(no)
 fi
 
diff --git a/options.c b/options.c
index 64ec8b84..522875c5 100644
--- a/options.c
+++ b/options.c
@@ -1866,16 +1866,6 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        create_refuse_error(refused_compress);
                        return 0;
                }
-#ifdef EXTERNAL_ZLIB
-               if (do_compression == 1) {
-                       snprintf(err_buf, sizeof err_buf,
-                               "This rsync lacks old-style --compress due to 
its external zlib.  Try -zz.\n");
-                       if (am_server)
-                               return 0;
-                       fprintf(stderr, "%s" "Continuing without 
compression.\n\n", err_buf);
-                       do_compression = 0;
-               }
-#endif
        }
 
 #ifdef HAVE_SETVBUF
diff --git a/token.c b/token.c
index ad9b9bcd..34bc331f 100644
--- a/token.c
+++ b/token.c
@@ -23,6 +23,10 @@
 #include "itypes.h"
 #include <zlib.h>
 
+#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. */
-#ifndef EXTERNAL_ZLIB
                do {
                        /* Break up long sections in the same way that
                         * see_deflate_token() does. */
@@ -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);
-#else
-               toklen++;
-               rprintf(FERROR, "Impossible error in external-zlib code 
(1).\n");
-               exit_cleanup(RERR_STREAMIO);
-#endif
        }
 }
 
@@ -579,7 +577,6 @@ static int32 recv_deflated_token(int f, char **data)
  */
 static void see_deflate_token(char *buf, int32 len)
 {
-#ifndef EXTERNAL_ZLIB
        int r;
        int32 blklen;
        unsigned char hdr[5];
@@ -617,11 +614,6 @@ static void see_deflate_token(char *buf, int32 len)
                        exit_cleanup(RERR_STREAMIO);
                }
        } while (len || rx_strm.avail_out == 0);
-#else
-       buf++; len++;
-       rprintf(FERROR, "Impossible error in external-zlib code (2).\n");
-       exit_cleanup(RERR_STREAMIO);
-#endif
 }
 
 /**
++++++ rsync-fix-external-compression.patch ++++++
Index: rsync-3.1.3/token.c
===================================================================
--- rsync-3.1.3.orig/token.c
+++ rsync-3.1.3/token.c
@@ -418,14 +418,16 @@ send_deflated_token(int f, int32 token,
                        tx_strm.avail_in = n1;
                        if (protocol_version >= 31) /* Newer protocols avoid a 
data-duplicating bug */
                                offset += n1;
-                       tx_strm.next_out = (Bytef *) obuf;
-                       tx_strm.avail_out = AVAIL_OUT_SIZE(CHUNK_SIZE);
-                       r = deflate(&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);
-                               exit_cleanup(RERR_STREAMIO);
-                       }
+                       do {
+                               tx_strm.next_out = (Bytef *) obuf;
+                               tx_strm.avail_out = AVAIL_OUT_SIZE(CHUNK_SIZE);
+                               r = deflate(&tx_strm, Z_INSERT_ONLY);
+                               if (r != Z_OK) {
+                                       rprintf(FERROR, "deflate on token 
returned %d (%d bytes left)\n",
+                                               r, tx_strm.avail_in);
+                                       exit_cleanup(RERR_STREAMIO);
+                               }
+                       } while (tx_strm.avail_in != 0);
                } while (toklen > 0);
        }
 }
++++++ rsync-fix-prealloc-to-keep-file-size-0-when-possible.patch ++++++
>From c2da3809f714d936dec1cab6d5bf8b724b9cd113 Mon Sep 17 00:00:00 2001
From: Wayne Davison <[email protected]>
Date: Tue, 15 Jan 2019 08:51:08 -0800
Subject: [PATCH] Fix --prealloc to keep file-size 0 when possible.

---
 syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/syscall.c b/syscall.c
index dbd556b8..0d1221b3 100644
--- a/syscall.c
+++ b/syscall.c
@@ -462,7 +462,7 @@ int do_utime(const char *fname, time_t modtime, 
UNUSED(uint32 mod_nsec))
 
 OFF_T do_fallocate(int fd, OFF_T offset, OFF_T length)
 {
-       int opts = inplace || preallocate_files ? 0 : DO_FALLOC_OPTIONS;
+       int opts = inplace || preallocate_files ? DO_FALLOC_OPTIONS : 0;
        int ret;
        RETURN_ERROR_IF(dry_run, 0);
        RETURN_ERROR_IF_RO_OR_LO;
-- 
2.16.4

++++++ rsync-iconv-segfault.patch ++++++
>From c0c6a97c35e8e4fb56ba26dc9c8447e26d94de06 Mon Sep 17 00:00:00 2001
From: Wayne Davison <[email protected]>
Date: Sat, 16 Mar 2019 11:49:53 -0700
Subject: [PATCH] Try to fix the iconv crash in bug 11338.

Applying Michal Ruprich's suggested patch for the rwrite() function that
should hopefully help with a bug that I couldn't reproduce.
---
 log.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/log.c b/log.c
index 21bcdfd9..a86edd74 100644
--- a/log.c
+++ b/log.c
@@ -378,10 +378,13 @@ void rwrite(enum logcode code, const char *buf, int len, 
int is_utf8)
                                filtered_fwrite(f, convbuf, outbuf.len, 0);
                                outbuf.len = 0;
                        }
-                       if (!ierrno || ierrno == E2BIG)
-                               continue;
-                       fprintf(f, "\\#%03o", CVAL(inbuf.buf, inbuf.pos++));
-                       inbuf.len--;
+                       /* Log one byte of illegal/incomplete sequence and 
continue with
+                        * the next character. Check that the buffer is 
non-empty for the
+                        * sake of robustness. */
+                       if ((ierrno == EILSEQ || ierrno == EINVAL) && 
inbuf.len) {
+                               fprintf(f, "\\#%03o", CVAL(inbuf.buf, 
inbuf.pos++));
+                               inbuf.len--;
+                       }
                }
        } else
 #endif
++++++ rsync-no-libattr.patch ++++++
--- rsync-3.1.1.orig/configure.ac
+++ rsync-3.1.1/configure.ac
@@ -1050,7 +1050,7 @@ else
        AC_DEFINE(HAVE_LINUX_XATTRS, 1, [True if you have Linux xattrs (or 
equivalent)])
        AC_DEFINE(SUPPORT_XATTRS, 1)
        AC_DEFINE(NO_SYMLINK_USER_XATTRS, 1, [True if symlinks do not support 
user xattrs])
-       AC_CHECK_LIB(attr,getxattr)
+       AC_SEARCH_LIBS([getxattr], [attr])
        ;;
     darwin*)
        AC_MSG_RESULT(Using OS X xattrs)
++++++ rsync-send_error_to_sender.patch ++++++
https://bugzilla.samba.org/show_bug.cgi?id=12522#c2

Index: rsync.h
===================================================================
--- rsync.h.orig
+++ rsync.h
@@ -167,6 +167,7 @@
 #define ATTRS_SKIP_MTIME       (1<<1)
 #define ATTRS_SET_NANO         (1<<2)
 
+#define MSG_FLUSH      2
 #define FULL_FLUSH     1
 #define NORMAL_FLUSH   0
 
Index: io.c
===================================================================
--- io.c.orig
+++ io.c
@@ -1994,10 +1994,11 @@ static void sleep_for_bwlimit(int bytes_
 void io_flush(int flush_it_all)
 {
        if (iobuf.out.len > iobuf.out_empty_len) {
-               if (flush_it_all) /* FULL_FLUSH: flush everything in the output 
buffers */
+               if (flush_it_all == FULL_FLUSH)        /* flush everything in 
the output buffers */
                        perform_io(iobuf.out.size - iobuf.out_empty_len, 
PIO_NEED_OUTROOM);
-               else /* NORMAL_FLUSH: flush at least 1 byte */
+               else if (flush_it_all == NORMAL_FLUSH) /* flush at least 1 byte 
*/
                        perform_io(iobuf.out.size - iobuf.out.len + 1, 
PIO_NEED_OUTROOM);
+                                                      /* MSG_FLUSH: flush 
iobuf.msg only */
        }
        if (iobuf.msg.len)
                perform_io(iobuf.msg.size, PIO_NEED_MSGROOM);
Index: cleanup.c
===================================================================
--- cleanup.c.orig
+++ cleanup.c
@@ -26,6 +26,7 @@ extern int dry_run;
 extern int am_server;
 extern int am_daemon;
 extern int am_receiver;
+extern int am_sender;
 extern int io_error;
 extern int keep_partial;
 extern int got_xfer_error;
@@ -243,15 +244,21 @@ NORETURN void _exit_cleanup(int code, co
                switch_step++;
 
                if (exit_code && exit_code != RERR_SOCKETIO && exit_code != 
RERR_STREAMIO && exit_code != RERR_SIGNAL1
-                && exit_code != RERR_TIMEOUT && !shutting_down && 
(protocol_version >= 31 || am_receiver)) {
-                       if (line > 0) {
-                               if (DEBUG_GTE(EXIT, 3)) {
-                                       rprintf(FINFO, "[%s] sending 
MSG_ERROR_EXIT with exit_code %d\n",
-                                               who_am_i(), exit_code);
+                && exit_code != RERR_TIMEOUT && !shutting_down) {
+                       if (protocol_version >= 31 || am_receiver) {
+                               if (line > 0) {
+                                       if (DEBUG_GTE(EXIT, 3)) {
+                                               rprintf(FINFO, "[%s] sending 
MSG_ERROR_EXIT with exit_code %d\n",
+                                                       who_am_i(), exit_code);
+                                       }
+                                       send_msg_int(MSG_ERROR_EXIT, exit_code);
                                }
-                               send_msg_int(MSG_ERROR_EXIT, exit_code);
+                               if (!am_sender)
+                                       io_flush(MSG_FLUSH); /* Be sure to send 
all messages */
+                               noop_io_until_death();
                        }
-                       noop_io_until_death();
+                       else if (!am_sender)
+                               io_flush(MSG_FLUSH); /* Be sure to send all 
messages */
                }
 
                /* FALLTHROUGH */
++++++ rsync-server.firewall ++++++
# Do not edit this file as it's just a template and will be
# overwritten on package updates! Copy to a new file instead.
#
# Only the variables TCP, UDP, RPC, IP and BROADCAST are allowed.
# More may be supported in the future.
#
# For a more detailed description of the individual variables see
# the comments for FW_SERVICES_*_EXT in /etc/sysconfig/SuSEfirewall2
#

## Name: Rsync server
## Description: Opens port for rsync server in order to allow remote 
synchronization

# space separated list of allowed TCP ports
TCP="rsync"

# space separated list of allowed UDP ports
UDP=""

# space separated list of allowed RPC services
RPC=""

# space separated list of allowed IP protocols
IP=""

# space separated list of allowed UDP broadcast ports
BROADCAST=""
++++++ rsync.keyring ++++++
pub   1024D/4B96A8C5 2003-12-19
uid                  Wayne Davison <[email protected]>
uid                  Wayne Davison <[email protected]>
sub   1024g/29C67D63 2003-12-19

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.9 (GNU/Linux)

mQGiBD/ja2cRBACZqtQ/VnuWd2TA/T4nFitXPOF//7uterTWZVMDBrSE3tJdW1lv
90z2g2RJKktJTC3yjs82IH6wWvvFsHDPGXQRuoBr0dPYHBaVhKX85uewigHiE2M1
1Ub8Vv1c/JDGAh1cNmCAWazghV+emamrWJWq0f0hz5eqq4LCcPwo4riUVwCg9W37
YAR8Z4NHa6FWjrEKjl2NIMUD/iXJnp6qJFMK9Fs+2dWyL1m/mRb0h+I/cqgpkUvo
gRhL95Jttg2QQtXJWCsB3hA/L/2Iu2bV8iS1aRlZQsAWogA3/m56ROs8cIyN4ouj
1dpPoG7sKGA8BTvXxuSF9l6ngx7208iX+xiQCDeGfBtBFBy70iJxTFGzp2mP3IiP
pwWtBACJ6l8UPwSRmp0Hz/N6H4RkzqGQnvYsMba/uPkRYou/14JsEGCQqjSB99UX
hsPg9wubCEpo3YFTf1p1j3OlbOhiiMkRFwyYaT1fqGjQK0w8hQ1yXHxbXffnz6e3
gKELz7fNQxS0L/tZkNOT7uyGuwnPsUDCBAzDPMwYVIFRo+MKZLQgV2F5bmUgRGF2
aXNvbiA8d2F5bmVkQHNhbWJhLm9yZz6IWwQTEQIAGwUCP+NrZwYLCQgHAwIDFQID
AxYCAQIeAQIXgAAKCRBshZ+xS5aoxbKaAJ98/UHW+BAmnsWCvCXYw5xAvjKQuwCg
7rJUYSl3xpb6YmIaBbyyw5QTKiC0LFdheW5lIERhdmlzb24gPHdheW5lZEB1c2Vy
cy5zb3VyY2Vmb3JnZS5uZXQ+iF4EExECAB4FAkFgW4ACGwMGCwkIBwMCAxUCAwMW
AgECHgECF4AACgkQbIWfsUuWqMXxFQCg9Dgb5SnWZroPGl25DL2OYFHdqV4An0N2
QQj0mVi18JgadtS4xv7yNiDauQENBD/ja3EQBADkZadXo4zP2P9XjCP9jCel2hIp
E/khYifgu8sLYQ3VOaVM6iczw71a+iM3C44CddioGNv0svJ/cEttbtAE5zZIfqm0
Rd/CYR+kqOkUydss736olRh+4lXLi9dAzDwHoEmlO+i95V6bDdSCAF9+XLhpfUY/
xtgistlUGTd+wyeQMwADBQP9HXUGOcR18VJsQtFOmXaXv9MSKZYMjCf9R5Z7gcPF
PSIWINyUvMEgnLIrUKJ7pgoA6cLDnYm/lBVP801u5C+D4s79oCnjS21wlOxA2Go0
hxG6XpT9mwBOWk4uZUK+g8Emeu7Vi6l3XwH8fACdCIfp3wKlqH/qtkqN7Gts95TM
59uIRgQYEQIABgUCP+NrcQAKCRBshZ+xS5aoxUisAKC2tk0y7PNjh9C9vbfx3fdA
gqiD8gCgg6qjwVbeddcrA0a84BB3zXnb93A=
=0IcW
-----END PGP PUBLIC KEY BLOCK-----
++++++ rsyncd.conf ++++++
gid = users
read only = true
use chroot = true
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
hosts allow = trusted.hosts
slp refresh = 300
use slp = false

#[Example]
#       path = /home/Example
#       comment = An Example
#       auth users = user
#       secrets file = /etc/rsyncd.secrets
++++++ rsyncd.rc ++++++
#! /bin/sh
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
# Copyright (c) 2002 SuSE Linux AG
#
# Author: Kurt Garloff <[email protected]>
#
# init.d/rsyncd
#
#   and symbolic its link
#
# /sbin/rcrsyncd
#
# System startup script for the rsync daemon
#
### BEGIN INIT INFO
# Provides: rsync
# Required-Start: $remote_fs $syslog
# Required-Stop:  $remote_fs $syslog
# Should-Start: slpd
# Should-Stop:  slpd
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Description:    Start the rsync server daemon
# Short-Description:    Start the rsync server daemon
### END INIT INFO

RSYNCD_BIN=/usr/sbin/rsyncd
test -x $RSYNCD_BIN || exit 5
RSYNCD_PID=/var/run/rsyncd.pid

# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     ditto but be verbose in local rc status
#      rc_status -v -r  ditto and clear the local rc status
#      rc_failed        set local and overall rc status to failed
#      rc_failed <num>  set local and overall rc status to <num><num>
#      rc_reset         clear local rc status (overall remains)
#      rc_exit          exit appropriate to overall rc status
. /etc/rc.status

# First reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
# 
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.

case "$1" in
    start)
        echo -n "Starting rsync daemon"
        ## Start daemon with startproc(8). If this fails
        ## the echo return value is set appropriate.

        # NOTE: startproc return 0, even if service is 
        # already running to match LSB spec.
        startproc -p $RSYNCD_PID -t 1 $RSYNCD_BIN --daemon

        # Remember status and be verbose
        rc_status -v
        ;;
    stop)
        echo -n "Shutting down rsync daemon"
        ## Stop daemon with killproc(8) and if this fails
        ## set echo the echo return value.

        killproc -p $RSYNCD_PID $RSYNCD_BIN

        # Remember status and be verbose
        rc_status -v
        ;;
    try-restart)
        ## Stop the service and if this succeeds (i.e. the 
        ## service was running before), start it again.
        ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
        $0 status >/dev/null &&  $0 restart

        # Remember status and be quiet
        rc_status
        ;;
    restart)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    force-reload)
        ## Signal the daemon to reload its config. Most daemons
        ## do this on signal 1 (SIGHUP).
        ## If it does not support it, restart.

        echo "Reload service rsync"
        "$0" restart
        rc_status -v
        ;;
    reload)
        # rsyncd does not catch SIGHUP
        echo -n "Reload service rsync"
        rc_failed 3
        rc_status -v
        ;;
    status)
        echo -n "Checking for rsync daemon: "
        ## Check status with checkproc(8), if process is running
        ## checkproc will return with exit status 0.

        # Status has a slightly different for the status command:
        # 0 - service running
        # 1 - service dead, but /var/run/  pid  file exists
        # 2 - service dead, but /var/lock/ lock file exists
        # 3 - service not running

        # NOTE: checkproc returns LSB compliant status values.
        checkproc -p $RSYNCD_PID $RSYNCD_BIN
        rc_status -v
        ;;
    *)
        echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload}"
        exit 1
        ;;
esac
rc_exit
++++++ rsyncd.secrets ++++++
# user:passwd
++++++ rsyncd.service ++++++
[Unit]
Description=Start the rsync server daemon
After=network.target
ConditionPathExists=/etc/rsyncd.conf

[Service]
ExecStart=/usr/sbin/rsyncd --daemon --no-detach
IOSchedulingClass=idle
CPUSchedulingPolicy=batch
PrivateTmp=true

[Install]
WantedBy=multi-user.target
++++++ rsyncd.socket ++++++
[Unit]
Description=Rsync Server Socket
Conflicts=rsyncd.service

[Socket]
ListenStream=873
Accept=yes

[Install]
WantedBy=sockets.target 
++++++ [email protected] ++++++
[Unit]
Description=Start the rsync server daemon
After=network.target
ConditionPathExists=/etc/rsyncd.conf

[Service]
ExecStart=/usr/sbin/rsyncd --daemon --no-detach
IOSchedulingClass=idle
CPUSchedulingPolicy=batch
PrivateTmp=true
StandardInput=socket

Reply via email to