[packages/rsync] Up to 3.5.2

arekm arekm at pld-linux.org
Wed Nov 4 23:33:52 CET 2026


commit 3328e0b465b226a30ea88f772bb939e1b1dd7dc5
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Nov 4 23:33:29 2026 +0100

    Up to 3.5.2
    
    Fixes CVE-2026-119741.

 rsync-config.patch                   | 122 ++++-----------------
 rsync-hash_search-overflow.patch     |  17 ---
 rsync-norandomfailure.patch          |  14 ++-
 rsync-rrsync-receiver-file-arg.patch | 198 -----------------------------------
 rsync.spec                           |  10 +-
 5 files changed, 31 insertions(+), 330 deletions(-)
---
diff --git a/rsync.spec b/rsync.spec
index c6fd2ce..43028ae 100644
--- a/rsync.spec
+++ b/rsync.spec
@@ -16,13 +16,13 @@ Summary(uk.UTF-8):	Програма для ефективного віддале
 Summary(zh_CN.UTF-8):	[通讯]传输工具
 Summary(zh_TW.UTF-8):	[喙啪]$(B6G?i火(c(B
 Name:		rsync
-Version:	3.5.1
-Release:	3
+Version:	3.5.2
+Release:	1
 Epoch:		1
 License:	GPL v3+
 Group:		Networking/Utilities
 Source0:	https://download.samba.org/pub/rsync/src/%{name}-%{version}.tar.gz
-# Source0-md5:	9b996a86c297a1e9cef0f92725dc825e
+# Source0-md5:	5402db5b3778b6cfef496bed612845d7
 Source2:	%{name}.inet
 Source3:	%{name}.init
 Source4:	%{name}.sysconfig
@@ -30,8 +30,6 @@ Source5:	%{name}d.logrotate
 Source6:	%{name}.tmpfiles
 Patch0:		%{name}-config.patch
 Patch1:         rsync-norandomfailure.patch
-Patch2:		%{name}-hash_search-overflow.patch
-Patch3:		%{name}-rrsync-receiver-file-arg.patch
 URL:		https://rsync.samba.org/
 BuildRequires:	acl-devel
 BuildRequires:	autoconf >= 2.69
@@ -193,8 +191,6 @@ techniczna nowego algorytmu została również dołączona do pakietu.
 %setup -q
 %patch -P0 -p1
 %patch -P1 -p1
-%patch -P2 -p1
-%patch -P3 -p1
 
 sed -i -e 's|#!/usr/bin/env bash|#!/bin/bash|' rsync-ssl
 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' support/rrsync
diff --git a/rsync-config.patch b/rsync-config.patch
index 084d888..aaa72ba 100644
--- a/rsync-config.patch
+++ b/rsync-config.patch
@@ -1,7 +1,11 @@
-diff -ur rsync-3.0.8.orig/rsync.h rsync-3.0.8/rsync.h
---- rsync-3.0.8.orig/rsync.h	2011-02-21 20:32:51.000000000 +0100
-+++ rsync-3.0.8/rsync.h	2011-04-07 10:21:07.794002236 +0200
-@@ -29,7 +29,7 @@
+PLD ships the daemon lock file in /var/lock and the daemon config/secrets in
+/etc/rsyncd; adjust the default lock path and the manpage examples to match.
+The generated *.1/*.5 manpages are rebuilt from these *.md sources at build
+time, so only the sources need patching.
+
+--- a/rsync.h
++++ b/rsync.h
+@@ -30,7 +30,7 @@
  /* RSYNCD_SYSCONF is now set in config.h */
  #define RSYNCD_USERCONF "rsyncd.conf"
  
@@ -10,29 +14,9 @@ diff -ur rsync-3.0.8.orig/rsync.h rsync-3.0.8/rsync.h
  #define URL_PREFIX "rsync://"
  
  #define SYMLINK_PREFIX "/rsyncd-munged/"  /* This MUST have a trailing slash! */
---- rsync-3.2.3/rsync.1.orig	2020-08-07 05:57:26.000000000 +0200
-+++ rsync-3.2.3/rsync.1	2020-08-16 14:32:06.591094708 +0200
-@@ -3423,7 +3423,7 @@
- .IP "\fB\-\-config=FILE\fP"
- This specifies an alternate config file than the default.  This is only
- relevant when \fB\-\-daemon\fP is specified.  The default is
--/etc/rsyncd.conf unless the daemon is running over a remote shell program
-+/etc/rsyncd/rsyncd.conf unless the daemon is running over a remote shell program
- and the remote user is not the super-user; in that case the default is
- rsyncd.conf in the current directory (typically $HOME).
- .IP "\fB\-\-dparam=OVERRIDE\fP, \fB\-M\fP"
-@@ -4260,7 +4260,7 @@
- .P
- .SH "FILES"
- .P
--/etc/rsyncd.conf or rsyncd.conf
-+/etc/rsyncd/rsyncd.conf or rsyncd.conf
- .P
- .SH "SEE ALSO"
- .P
---- rsync-3.2.3/rsync.1.md.orig	2020-07-28 00:56:48.000000000 +0200
-+++ rsync-3.2.3/rsync.1.md	2020-08-16 14:33:28.887315538 +0200
-@@ -3380,7 +3380,7 @@
+--- a/rsync.1.md
++++ b/rsync.1.md
+@@ -4213,7 +4213,7 @@
  
      This specifies an alternate config file than the default.  This is only
      relevant when [`--daemon`](#dopt) is specified.  The default is
@@ -41,7 +25,7 @@ diff -ur rsync-3.0.8.orig/rsync.h rsync-3.0.8/rsync.h
      and the remote user is not the super-user; in that case the default is
      rsyncd.conf in the current directory (typically $HOME).
  
-@@ -4117,7 +4117,7 @@
+@@ -5169,7 +5169,7 @@
  
  ## FILES
  
@@ -50,79 +34,9 @@ diff -ur rsync-3.0.8.orig/rsync.h rsync-3.0.8/rsync.h
  
  ## SEE ALSO
  
---- rsync-3.2.3/rsyncd.conf.5.orig	2020-08-07 05:57:26.000000000 +0200
-+++ rsync-3.2.3/rsyncd.conf.5	2020-08-16 18:54:27.322486513 +0200
-@@ -393,7 +393,7 @@
- This parameter specifies the file to use to support the "max connections"
- parameter. The rsync daemon uses record locking on this file to ensure that
- the max connections limit is not exceeded for the modules sharing the lock
--file.  The default is \fB/var/run/rsyncd.lock\fP.
-+file.  The default is \fB/var/lock/rsyncd.lock\fP.
- .IP "\fBread\ only\fP"
- This parameter determines whether clients will be able to upload files or
- not. If "read only" is true then any attempted uploads will fail. If
-@@ -632,7 +632,7 @@
- passwords.
- .IP
- There is no default for the "secrets file" parameter, you must choose a
--name (such as \fB/etc/rsyncd.secrets\fP).  Unless "strict modes" is
-+name (such as \fB/etc/rsyncd/rsyncd.secrets\fP).  Unless "strict modes" is
- disabled, the file must not be readable or writable by "other", and (when
- the daemon runs as root) must be owned by root; see "strict modes" for
- the exact check.  If the file is not found or is rejected, no logins for an
-@@ -1092,7 +1092,7 @@
- global values that will affect connections (such as \fBmotd\ file\fP), or globals
- that will affect other include files.
- .P
--For example, this is a useful /etc/rsyncd.conf file:
-+For example, this is a useful /etc/rsyncd/rsyncd.conf file:
- .RS 4
- .P
- .nf
-@@ -1100,13 +1100,13 @@
- log file = /var/log/rsync.log
- pid file = /var/lock/rsync.lock
- 
--&merge /etc/rsyncd.d
--&include /etc/rsyncd.d
-+&merge /etc/rsyncd/rsyncd.d
-+&include /etc/rsyncd/rsyncd.d
- .fi
- .RE
- .P
--This would merge any \fB/etc/rsyncd.d/*.inc\fP files (for global values that should
--stay in effect), and then include any \fB/etc/rsyncd.d/*.conf\fP files (defining
-+This would merge any \fB/etc/rsyncd/rsyncd.d/*.inc\fP files (for global values that should
-+stay in effect), and then include any \fB/etc/rsyncd/rsyncd.d/*.conf\fP files (defining
- modules without any global-value cross-talk).
- .P
- .SH "SECURITY"
-@@ -1219,11 +1219,11 @@
-         path = /data/cvs
-         comment = CVS repository (requires authentication)
-         auth users = tridge, susan
--        secrets file = /etc/rsyncd.secrets
-+        secrets file = /etc/rsyncd/rsyncd.secrets
- .fi
- .RE
- .P
--The /etc/rsyncd.secrets file would look something like this:
-+The /etc/rsyncd/rsyncd.secrets file would look something like this:
- .RS 4
- .P
- .nf
-@@ -1234,7 +1234,7 @@
- .P
- .SH "FILES"
- .P
--/etc/rsyncd.conf or rsyncd.conf
-+/etc/rsyncd/rsyncd.conf or rsyncd.conf
- .P
- .SH "SEE ALSO"
- .P
---- rsync-3.2.3/rsyncd.conf.5.md.orig	2020-08-16 14:34:12.567078905 +0200
-+++ rsync-3.2.3/rsyncd.conf.5.md	2020-08-16 18:53:50.806017673 +0200
-@@ -417,7 +417,7 @@
+--- a/rsyncd.conf.5.md
++++ b/rsyncd.conf.5.md
+@@ -495,7 +495,7 @@
      This parameter specifies the file to use to support the "[max connections](#)"
      parameter. The rsync daemon uses record locking on this file to ensure that
      the max connections limit is not exceeded for the modules sharing the lock
@@ -131,7 +45,7 @@ diff -ur rsync-3.0.8.orig/rsync.h rsync-3.0.8/rsync.h
  
  0.  `read only`
  
-@@ -680,7 +680,7 @@
+@@ -768,7 +768,7 @@
      passwords.
  
      There is no default for the "secrets file" parameter, you must choose a
@@ -140,7 +54,7 @@ diff -ur rsync-3.0.8.orig/rsync.h rsync-3.0.8/rsync.h
      disabled, the file must not be readable or writable by "other", and (when
      the daemon runs as root) must be owned by root; see "[strict modes](#)" for
      the exact check.  If the file is not found or is rejected, no logins for an
-@@ -1075,17 +1075,17 @@
+@@ -1271,17 +1271,17 @@
  global values that will affect connections (such as `motd file`), or globals
  that will affect other include files.
  
@@ -163,7 +77,7 @@ diff -ur rsync-3.0.8.orig/rsync.h rsync-3.0.8/rsync.h
  modules without any global-value cross-talk).
  
  ## SECURITY
-@@ -1189,17 +1189,17 @@
+@@ -1445,17 +1445,17 @@
  >         path = /data/cvs
  >         comment = CVS repository (requires authentication)
  >         auth users = tridge, susan
diff --git a/rsync-hash_search-overflow.patch b/rsync-hash_search-overflow.patch
deleted file mode 100644
index 4896957..0000000
--- a/rsync-hash_search-overflow.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Bound aligned_i in hash_search(): a malicious peer with tiny blength/count makes it
-overflow past INT32_MAX on --inplace >2 GiB files -> negative s->sums[] index.
-https://github.com/RsyncProject/rsync/commit/9dc0ff638c
-
-diff --git a/match.c b/match.c
-index 4fa3b8599..62029208d 100644
---- a/match.c
-+++ b/match.c
-@@ -277,7 +277,7 @@ static void hash_search(int f,struct sum_struct *s,
- 			 * the adjacent want_i optimization. */
- 			if (updating_basis_file) {
- 				/* All the generator's chunks start at blength boundaries. */
--				while (aligned_offset < offset) {
-+				while (aligned_offset < offset && aligned_i < s->count) {
- 					aligned_offset += s->blength;
- 					aligned_i++;
- 				}
diff --git a/rsync-norandomfailure.patch b/rsync-norandomfailure.patch
index 541bcdb..085d743 100644
--- a/rsync-norandomfailure.patch
+++ b/rsync-norandomfailure.patch
@@ -1,7 +1,13 @@
-diff -urN rsync-3.2.7.org/Makefile.in rsync-3.2.7/Makefile.in
---- rsync-3.2.7.org/Makefile.in	2022-10-02 20:26:44.000000000 +0200
-+++ rsync-3.2.7/Makefile.in	2022-10-26 13:05:40.582652642 +0200
-@@ -196,31 +196,6 @@
+The spec regenerates configure.sh/config.h.in itself via aclocal/autoheader/
+autoconf in %build. The Makefile's own configure.sh regeneration rule then sees
+aclocal.m4 newer than configure.sh during "make" and re-runs autoconf, whose
+diff-vs-old check can spuriously fail with "make reconfigure" (exit 1) and abort
+a build that is otherwise fine. Drop the rule's recipe so make never tries to
+regenerate configure.sh on its own.
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -310,31 +310,6 @@
  	aclocal -I $(srcdir)/m4
  
  configure.sh config.h.in: configure.ac aclocal.m4
diff --git a/rsync-rrsync-receiver-file-arg.patch b/rsync-rrsync-receiver-file-arg.patch
deleted file mode 100644
index e28f14b..0000000
--- a/rsync-rrsync-receiver-file-arg.patch
+++ /dev/null
@@ -1,198 +0,0 @@
-rrsync: pin the parent of existing receiver file arguments; without it an
-upload onto an existing file fails with EPERM on the /proc/self/fd link.
-https://github.com/RsyncProject/rsync/commit/92a2a09e3f (#1107, #1136)
-
---- a/support/rrsync
-+++ b/support/rrsync
-@@ -375,7 +375,7 @@
-     pinned_fds.append(fd)
-     return '/proc/self/fd/%d' % fd
- 
--# sender_pinned_arg() verdicts that are not a rewritten argument.
-+# Pinned-argument verdicts that are not a rewritten argument.
- KEEP_LEAF_PIN = 'keep'          # hand rsync the leaf's own /proc/self/fd/N
- LEAF_PIN_UNUSABLE = 'unusable'  # no pin for this shape; keep the plain name
- 
-@@ -452,6 +452,22 @@
-         die('post-pin path changed (race?):', orig_arg, check)
-     return pinned
- 
-+def receiver_pinned_arg(fd, arg, orig_arg):
-+    """Keep existing file destinations writable beneath a pinned parent."""
-+    leaf_st = os.fstat(fd)
-+    if stat.S_ISDIR(leaf_st.st_mode):
-+        return KEEP_LEAF_PIN
-+
-+    parent, leaf = os.path.split(arg)
-+    dfd = pin_dir(parent, orig_arg)
-+    try:
-+        st = os.stat(leaf, dir_fd=dfd, follow_symlinks=False)
-+    except OSError as e:
-+        die('post-pin stat failed (race?):', orig_arg, e.strerror)
-+    if (st.st_dev, st.st_ino) != (leaf_st.st_dev, leaf_st.st_ino):
-+        die('post-pin path changed (race?):', orig_arg, leaf)
-+    return '/proc/self/fd/%d/%s' % (dfd, leaf)
-+
- def safe_open_logfile():
-     nofollow = getattr(os, 'O_NOFOLLOW', 0)
-     try:
-@@ -923,6 +939,8 @@
-                         pinned = sender_pinned_arg(fd, logical, orig_arg,
-                                                    arg_has_trailing_slash,
-                                                    arg_has_trailing_slash_dot)
-+                    elif opt == 'arg':
-+                        pinned = receiver_pinned_arg(fd, real_arg, orig_arg)
-                     else:
-                         pinned = KEEP_LEAF_PIN
-                     if pinned == KEEP_LEAF_PIN:
---- /dev/null
-+++ b/testsuite/rrsync-receiver-file-arg_test.py
-@@ -0,0 +1,148 @@
-+#!/usr/bin/env python3
-+"""Receiver file arguments must remain beneath a pinned parent."""
-+
-+import os
-+import shlex
-+import subprocess
-+import time
-+
-+from rsyncfns import (
-+    SCRATCHDIR, makepath, patched_rrsync, proc_self_fd_pins, rmtree,
-+    rsync_argv, test_fail, test_skipped,
-+)
-+
-+if not proc_self_fd_pins():
-+    test_skipped('requires /proc/self/fd directory pins')
-+
-+base = SCRATCHDIR / 'rrsync-receiver-file'
-+rmtree(base)
-+restricted = base / 'restricted'
-+outside = base / 'outside'
-+source = base / 'source'
-+downloads = base / 'downloads'
-+makepath(restricted, outside, downloads)
-+source.write_text('replacement contents\n')
-+
-+# The optional gate pauses the real server after rrsync validates its argument.
-+shim = base / 'rsync-shim'
-+shim.write_text('''#!/usr/bin/env python3
-+import os, pathlib, sys, time
-+ready = os.environ.get('RRSYNC_TEST_READY')
-+if ready:
-+    pathlib.Path(ready).touch()
-+    go = pathlib.Path(os.environ['RRSYNC_TEST_GO'])
-+    end = time.monotonic() + 10
-+    while not go.exists():
-+        if time.monotonic() >= end:
-+            sys.exit('timed out waiting for test gate')
-+        time.sleep(0.01)
-+cmd = %r
-+os.execvp(cmd[0], cmd + sys.argv[1:])
-+''' % rsync_argv())
-+shim.chmod(0o755)
-+rrsync = patched_rrsync(base, rsync_path=str(shim))
-+rsh = base / 'fake-rsh'
-+rsh.write_text('#!/bin/sh\nshift\nSSH_ORIGINAL_COMMAND="$*"\n'
-+               'export SSH_ORIGINAL_COMMAND\nexec %s -no-lock %s\n'
-+               % (shlex.quote(str(rrsync)), shlex.quote(str(restricted))))
-+rsh.chmod(0o755)
-+
-+
-+def command(src, dest, *options):
-+    return rsync_argv('-ac', '-e', str(rsh), *options, str(src), str(dest))
-+
-+
-+def transfer(src, dest, *options, succeeds=True):
-+    proc = subprocess.run(command(src, dest, *options), capture_output=True,
-+                          text=True, timeout=20)
-+    if (proc.returncode == 0) != succeeds:
-+        test_fail(f'transfer {src} -> {dest}: rc={proc.returncode}, '
-+                  f'{proc.stdout!r} {proc.stderr!r}')
-+    return proc
-+
-+
-+def check_contents(path):
-+    if path.is_symlink() or not path.is_file() or path.read_text() != source.read_text():
-+        test_fail(f'wrong file contents or type: {path}')
-+
-+
-+for option in ((), ('--inplace',)):
-+    destination = restricted / 'existing'
-+    destination.write_text('old\n')
-+    transfer(source, 'dummy:existing', *option)
-+    check_contents(destination)
-+    new = restricted / 'new'
-+    new.unlink(missing_ok=True)
-+    transfer(source, 'dummy:new', *option)
-+    check_contents(new)
-+
-+makepath(restricted / 'directory')
-+transfer(source, 'dummy:directory/')
-+check_contents(restricted / 'directory' / source.name)
-+transfer('dummy:existing', str(downloads) + '/')
-+check_contents(downloads / 'existing')
-+
-+marker = outside / 'untouched'
-+marker.write_text('outside fixture\n')
-+transfer(source, 'dummy:../outside/untouched', succeeds=False)
-+(restricted / 'outside-link').symlink_to(outside, target_is_directory=True)
-+transfer(source, 'dummy:outside-link/untouched', succeeds=False)
-+if marker.read_text() != 'outside fixture\n':
-+    test_fail('a rejected destination changed the outside fixture')
-+
-+
-+def gated_transfer(name, change):
-+    ready = base / 'ready'
-+    go = base / 'go'
-+    ready.unlink(missing_ok=True)
-+    go.unlink(missing_ok=True)
-+    env = {**os.environ, 'RRSYNC_TEST_READY': str(ready), 'RRSYNC_TEST_GO': str(go)}
-+    proc = subprocess.Popen(command(source, f'dummy:{name}', '--inplace'),
-+                            stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-+                            text=True, env=env)
-+    try:
-+        end = time.monotonic() + 10
-+        while not ready.exists():
-+            if proc.poll() is not None or time.monotonic() >= end:
-+                test_fail('receiver did not reach the post-validation gate')
-+            time.sleep(0.01)
-+        change()
-+        go.touch()
-+        stdout, stderr = proc.communicate(timeout=20)
-+        if marker.read_text() != 'outside fixture\n':
-+            test_fail(f'in-place transfer changed the outside fixture: {stdout} {stderr}')
-+        return proc.returncode
-+    finally:
-+        if proc.poll() is None:
-+            proc.kill()
-+            proc.communicate()
-+
-+
-+leaf = restricted / 'raced-leaf'
-+leaf.write_text('old\n')
-+
-+
-+def replace_leaf():
-+    leaf.unlink()
-+    leaf.symlink_to(marker)
-+
-+
-+rc = gated_transfer('raced-leaf', replace_leaf)
-+if rc == 0:
-+    check_contents(leaf)
-+
-+parent = restricted / 'raced-parent'
-+makepath(parent)
-+(parent / 'untouched').write_text('old\n')
-+saved_parent = restricted / 'saved-parent'
-+
-+
-+def replace_parent():
-+    parent.rename(saved_parent)
-+    parent.symlink_to(outside, target_is_directory=True)
-+
-+
-+if gated_transfer('raced-parent/untouched', replace_parent) == 0:
-+    check_contents(saved_parent / 'untouched')
-+
-+print('rrsync receiver file overwrite, creation, directory, pull and path checks passed')
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rsync.git/commitdiff/3328e0b465b226a30ea88f772bb939e1b1dd7dc5



More information about the pld-cvs-commit mailing list