Sync from SUSE:SLFO:Main rsync revision 6fc6f22ab02a0cf9f0021f40e018a75c

This commit is contained in:
Adrian Schröter 2024-09-30 10:45:40 +02:00
parent 0154da6139
commit 207750b25c
14 changed files with 263 additions and 127 deletions

BIN
rsync-3.2.7.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,6 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQQASMiwJtTJbw5YnC9shZ+xS5aoxQUCY1HvAwAKCRBshZ+xS5ao
xZFiAKC3MJgYOMf5VfpfAbld/+ydZRznMQCgkF/yaDJvKMNOslSRNuMZ/eXZ84g=
=Q+uI
-----END PGP SIGNATURE-----

BIN
rsync-3.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

6
rsync-3.3.0.tar.gz.asc Normal file
View File

@ -0,0 +1,6 @@
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQQASMiwJtTJbw5YnC9shZ+xS5aoxQUCZhF6vQAKCRBshZ+xS5ao
xZ6kAKDZkE3C9w/cu8o3/Ic5KNycbcTw8gCdH/pdNo6kSGF3qLelFI6uK5Q4jdA=
=vJGJ
-----END PGP SIGNATURE-----

View File

@ -1,48 +0,0 @@
From 1f83963f59960150e8c46112daa8411324c1f209 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jslaby@suse.cz>
Date: Fri, 18 Aug 2023 08:26:20 +0200
Subject: [PATCH] exclude: fix crashes with fortified strlcpy()
Fortified (-D_FORTIFY_SOURCE=2 for gcc) builds make strlcpy() crash when
its third parameter (size) is larger than the buffer:
$ rsync -FFXHav '--filter=merge global-rsync-filter' Align-37-43/ xxx
sending incremental file list
*** buffer overflow detected ***: terminated
It's in the exclude code in setup_merge_file():
strlcpy(y, save, MAXPATHLEN);
Note the 'y' pointer was incremented, so it no longer points to memory
with MAXPATHLEN "owned" bytes.
Fix it by remembering the number of copied bytes into the 'save' buffer
and use that instead of MAXPATHLEN which is clearly incorrect.
Fixes #511.
---
exclude.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/exclude.c b/exclude.c
index ffe55b167..1a5de3b9e 100644
--- a/exclude.c
+++ b/exclude.c
@@ -720,7 +720,8 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex,
parent_dirscan = True;
while (*y) {
char save[MAXPATHLEN];
- strlcpy(save, y, MAXPATHLEN);
+ /* copylen is strlen(y) which is < MAXPATHLEN. +1 for \0 */
+ size_t copylen = strlcpy(save, y, MAXPATHLEN) + 1;
*y = '\0';
dirbuf_len = y - dirbuf;
strlcpy(x, ex->pattern, MAXPATHLEN - (x - buf));
@@ -734,7 +735,7 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex,
lp->head = NULL;
}
lp->tail = NULL;
- strlcpy(y, save, MAXPATHLEN);
+ strlcpy(y, save, copylen);
while ((*x++ = *y++) != '/') {}
}
parent_dirscan = False;

BIN
rsync-patches-3.2.7.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,6 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQQASMiwJtTJbw5YnC9shZ+xS5aoxQUCY1HvAwAKCRBshZ+xS5ao
xR3uAJ46yBJwj44DSq5YGtnUJKhLHUJLjwCfbcdunUI6bpF6Yp4IGgPUSxHIsoI=
=+RP4
-----END PGP SIGNATURE-----

BIN
rsync-patches-3.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQQASMiwJtTJbw5YnC9shZ+xS5aoxQUCZhF6vQAKCRBshZ+xS5ao
xcOpAJ0e/0uM2Ds98F7lwsTWiYdsJJ4EGwCfU4SaBIySxtKPdHh0Qy6Y1dt8uTc=
=dZu7
-----END PGP SIGNATURE-----

12
rsync-run-dir.patch Normal file
View File

@ -0,0 +1,12 @@
diff -ur rsync-3.3.0.old/rsync.h rsync-3.3.0/rsync.h
--- rsync-3.3.0.old/rsync.h 2022-10-16 19:28:58.000000000 +0200
+++ rsync-3.3.0/rsync.h 2024-08-26 11:31:14.458919925 +0200
@@ -30,7 +30,7 @@
/* RSYNCD_SYSCONF is now set in config.h */
#define RSYNCD_USERCONF "rsyncd.conf"
-#define DEFAULT_LOCK_FILE "/var/run/rsyncd.lock"
+#define DEFAULT_LOCK_FILE "/run/rsyncd.lock"
#define URL_PREFIX "rsync://"
#define SYMLINK_PREFIX "/rsyncd-munged/" /* This MUST have a trailing slash! */

76
rsync-usr-etc.patch Normal file
View File

@ -0,0 +1,76 @@
Nur in a: .cirrus.yml.
diff -ur a/clientserver.c b/clientserver.c
--- a/clientserver.c 2023-11-28 17:12:41.643268046 +0100
+++ b/clientserver.c 2023-11-28 17:25:30.476279700 +0100
@@ -1261,10 +1261,16 @@
static int load_config(int globals_only)
{
if (!config_file) {
- if (am_daemon < 0 && am_root <= 0)
+ if (am_daemon < 0 && am_root <= 0) {
config_file = RSYNCD_USERCONF;
- else
+ } else {
config_file = RSYNCD_SYSCONF;
+#ifdef RSYNCD_DISTCONF
+ STRUCT_STAT st;
+ if (do_stat(RSYNCD_SYSCONF, &st) != 0)
+ config_file = RSYNCD_DISTCONF;
+#endif
+ }
}
return lp_load(config_file, globals_only);
}
diff -ur a/configure.ac b/configure.ac
--- a/configure.ac 2023-11-28 17:12:41.647268046 +0100
+++ b/configure.ac 2023-11-28 17:40:15.678280030 +0100
@@ -175,7 +175,7 @@
AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
AC_ARG_WITH(rsyncd-conf,
- AS_HELP_STRING([--with-rsyncd-conf=PATH],[set configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]),
+ AS_HELP_STRING([--with-rsyncd-conf=PATH],[set user/admin defined configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]),
[ if test ! -z "$with_rsyncd_conf" ; then
case $with_rsyncd_conf in
yes|no)
@@ -193,7 +193,27 @@
fi ],
[ RSYNCD_SYSCONF="/etc/rsyncd.conf" ])
-AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of configuration file for rsync server])
+AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of user/admin defined configuration file for rsync server])
+
+AC_ARG_WITH(rsyncd-distconf,
+ AS_HELP_STRING([--with-rsyncd-distconf=PATH],[set vendor configuration file for rsync server to PATH (default: not set)]),
+ [ if test ! -z "$with_rsyncd_distconf" ; then
+ case $with_rsyncd_distconf in
+ yes|no)
+ RSYNCD_DISTCONF="/usr/etc/rsyncd.conf"
+ ;;
+ /*)
+ RSYNCD_DISTCONF="$with_rsyncd_distconf"
+ ;;
+ *)
+ AC_MSG_ERROR(You must specify an absolute path to --with-rsyncd-distconf=PATH)
+ ;;
+ esac
+ fi
+ ],
+ [])
+
+AC_DEFINE_UNQUOTED(RSYNCD_DISTCONF, "$RSYNCD_DISTCONF", [location of vendor configuration file for rsync server])
AC_ARG_WITH(rsh,
AS_HELP_STRING([--with-rsh=CMD],[set remote shell command to CMD (default: ssh)]))
diff -ur a/rsyncd.conf.5.md b/rsyncd.conf.5.md
--- a/rsyncd.conf.5.md 2023-11-28 17:12:41.643268046 +0100
+++ b/rsyncd.conf.5.md 2023-11-29 13:08:32.125333095 +0100
@@ -1235,7 +1235,7 @@
## FILES
-/etc/rsyncd.conf or rsyncd.conf
+rsyncd.conf or /etc/rsyncd.conf or /usr/etc/rsyncd.conf
## SEE ALSO

View File

@ -1,3 +1,87 @@
-------------------------------------------------------------------
Mon Aug 26 09:41:28 UTC 2024 - Thorsten Kukuk <kukuk@suse.com>
- add patch rsync-run-dir.patch:
* Drop dependency on /var/run compat symlink, this causes problems
on image based systems
-------------------------------------------------------------------
Thu May 23 11:50:19 UTC 2024 - David Anes <david.anes@suse.com>
- Correcly enable SIMD in x64: the flag was renamed from
--enable-simd to -enable-roll-simd in 3.2.4
- Remove leftovers from previous versions:
* rsync-patches-3.2.7.tar.gz
* rsync-patches-3.2.7.tar.gz.asc
-------------------------------------------------------------------
Thu Apr 18 08:22:02 UTC 2024 - David Anes <david.anes@suse.com>
- Update to 3.3.0
* BUG FIXES:
- Fixed a bug with --sparse --inplace where a trailing gap in
the source file would not clear out the trailing data in the
destination file.
- Fixed an buffer overflow in the checksum2 code if SHA1 is
being used for the checksum2 algorithm.
- Fixed an issue when rsync is compiled using _FORTIFY_SOURCE so
that the extra tests don't complain about a strlcpy() limit
value (which was too large, even though it wasn't possible for
the larger value to cause an overflow).
(fix bsc#1214616, bsc#1214249)
- Add a backtick to the list of characters that the filename
quoting needs to escape using backslashes.
- Fixed a string-comparison issue in the internal handling of
--progress (a locale such as tr_TR.utf-8 needed the internal
triggering of --info options to use upper-case flag names to
ensure that they match).
- Make sure that a local transfer marks the sender side as
trusted.
- Change the argv handling to work with a newer popt library
-- one that likes to free more data than it used to.
- Rsync now calls OpenSSL_add_all_algorithms() when compiled
against an older openssl library.
- Fixed a problem in the daemon auth for older protocols
(29 and before) if the openssl library is being used to
compute MD4 checksums.
- Fixed rsync -VV on Cygwin -- it needed a flush of stdout.
- Fixed an old stats bug that counted devices as symlinks.
* ENHANCEMENTS:
- Enhanced rrsync with the -no-overwrite option that allows you
to ensure that existing files on your restricted but writable
directory can't be modified.
- Enhanced the manpages to mark links with .UR & .UE. If your
nroff doesn't support these idioms, touch the file
.md2man-force in the source directory so that md-convert gets
called with the --force-link-text option, and that should
ensure that your manpages are still readable even with the
ignored markup.
- Some manpage improvements on the handling of [global] modules.
- Changed the mapfrom & mapto perl scripts (in the support dir)
into a single python script named idmap. Converted a couple
more perl scripts into python.
- Changed the mnt-excl perl script (in the support dir) into a
python script.
* DEVELOPER RELATED:
- Updated config.guess (timestamp 2023-01-01) and config.sub
(timestamp 2023-01-21).
- Drop rsync-fortified-strlcpy-fix.patch (included upstream).
-------------------------------------------------------------------
Tue Mar 12 08:13:24 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
- Avoid package changes in %check
-------------------------------------------------------------------
Wed Nov 29 12:34:30 UTC 2023 - Stefan Schubert <schubi@suse.com>
- Moved rsyncd.conf and rsyncd.secrets to /usr/etc.
* Add rsync-usr-etc.patch
-------------------------------------------------------------------
Wed Sep 6 09:52:41 UTC 2023 - David Anes <david.anes@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package rsync
#
# Copyright (c) 2023 SUSE LLC
# 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
@ -35,7 +35,7 @@
%endif
Name: rsync
Version: 3.2.7
Version: 3.3.0
Release: 0
Summary: Versatile tool for fast incremental file transfer
License: GPL-3.0-or-later
@ -55,7 +55,8 @@ Source11: https://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.t
Source12: %{name}.keyring
Source13: rsyncd
Patch0: rsync-no-libattr.patch
Patch1: rsync-fortified-strlcpy-fix.patch
Patch2: rsync-usr-etc.patch
Patch3: rsync-run-dir.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: c++_compiler
@ -113,11 +114,14 @@ export LDFLAGS="-Wl,-z,relro,-z,now -fPIE -pie"
--with-included-popt=no \
--with-included-zlib=no \
--disable-debug \
%if 0%{?suse_version} > 1500
--with-rsyncd-distconf=%{_distconfdir}/rsyncd.conf \
%endif
%if !%{with xxhash}
--disable-xxhash\
%endif
%ifarch x86_64
--enable-simd \
--enable-roll-simd \
%endif
%if %{with slp}
--enable-slp \
@ -128,6 +132,7 @@ export LDFLAGS="-Wl,-z,relro,-z,now -fPIE -pie"
%make_build
%check
chmod +x support/*
%make_build check
chmod -x support/*
@ -142,22 +147,27 @@ install -m 755 support/rsyncstats %{buildroot}%{_bindir}
%if 0%{?suse_version} > 1500
install -d %{buildroot}%{_distconfdir}/logrotate.d
install -m 644 %{SOURCE2} %{buildroot}%{_distconfdir}/logrotate.d/rsync
install -m 644 %{SOURCE5} %{buildroot}%{_distconfdir}/rsyncd.conf
install -m 600 %{SOURCE6} %{buildroot}%{_distconfdir}/rsyncd.secrets
echo "# This is a template only. Create your own entries in /etc/rsyncd.secrets" >>%{buildroot}%{_distconfdir}/rsyncd.secrets
echo
%else
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/rsync
%endif
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rsyncd.conf
install -m 600 %{SOURCE6} %{buildroot}%{_sysconfdir}/rsyncd.secrets
%endif
install -D -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/rsyncd@.service
install -D -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/rsyncd.service
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/rsyncd.socket
ln -sf service %{buildroot}%{_sbindir}/rcrsyncd
chmod -x support/*
%pre
%service_add_pre rsyncd.service
%if 0%{?suse_version} > 1500
# Prepare for migration to /usr/etc; save any old .rpmsave
for i in logrotate.d/rsync ; do
for i in logrotate.d/rsync rsyncd.conf rsyncd.secrets; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
done
%endif
@ -165,7 +175,7 @@ done
%if 0%{?suse_version} > 1500
%posttrans
# Migration to /usr/etc, restore just created .rpmsave
for i in logrotate.d/rsync ; do
for i in logrotate.d/rsync rsyncd.conf rsyncd.secrets; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
done
%endif
@ -185,12 +195,14 @@ done
%{_unitdir}/rsyncd@.service
%{_unitdir}/rsyncd.service
%{_unitdir}/rsyncd.socket
%config(noreplace) %{_sysconfdir}/rsyncd.conf
%config(noreplace) %{_sysconfdir}/rsyncd.secrets
%if 0%{?suse_version} > 1500
%{_distconfdir}/logrotate.d/rsync
%{_distconfdir}/rsyncd.conf
%{_distconfdir}/rsyncd.secrets
%else
%config(noreplace) %{_sysconfdir}/logrotate.d/rsync
%config(noreplace) %{_sysconfdir}/rsyncd.conf
%config(noreplace) %{_sysconfdir}/rsyncd.secrets
%endif
%{_sbindir}/rcrsyncd
%{_sbindir}/rsyncd

View File

@ -4,7 +4,7 @@ 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
pid file = /run/rsyncd.pid
hosts allow = trusted.hosts
slp refresh = 300
use slp = false