Skip to content

Commit 556503f

Browse files
authored
Merge branch 'RsyncProject:master' into time-only-option
2 parents be72993 + 5bcb3de commit 556503f

61 files changed

Lines changed: 1781 additions & 1611 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cygwin-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: info
4040
run: bash -c '/usr/local/bin/rsync --version'
4141
- name: check
42-
run: bash -c 'RSYNC_EXPECT_SKIPPED=acls-default,acls,chown,devices,dir-sgid,protected-regular make check'
42+
run: bash -c 'RSYNC_EXPECT_SKIPPED=acls-default,acls,chown,devices,dir-sgid,open-noatime,protected-regular,simd-checksum make check'
4343
- name: ssl file list
4444
run: bash -c 'PATH="/usr/local/bin:$PATH" rsync-ssl --no-motd download.samba.org::rsyncftp/ || true'
4545
- name: save artifact

.github/workflows/macos-build.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,27 @@ jobs:
2525
- name: prep
2626
run: |
2727
brew install automake openssl xxhash zstd lz4
28-
sudo pip3 install commonmark
29-
echo "/usr/local/bin" >>$GITHUB_PATH
28+
pip3 install --user --break-system-packages commonmark
29+
echo "$(brew --prefix)/bin" >>$GITHUB_PATH
3030
- name: configure
31-
run: CPPFLAGS=-I/usr/local/opt/openssl/include/ LDFLAGS=-L/usr/local/opt/openssl/lib/ ./configure --with-rrsync
31+
run: |
32+
BREW_PREFIX=$(brew --prefix)
33+
OPENSSL_PREFIX=$(brew --prefix openssl)
34+
CPPFLAGS="-I${BREW_PREFIX}/include -I${OPENSSL_PREFIX}/include" \
35+
LDFLAGS="-L${BREW_PREFIX}/lib -L${OPENSSL_PREFIX}/lib" \
36+
./configure --with-rrsync
3237
- name: make
3338
run: make
3439
- name: install
3540
run: sudo make install
3641
- name: info
3742
run: rsync --version
3843
- name: check
39-
run: sudo RSYNC_EXPECT_SKIPPED=acls-default,chmod-temp-dir,chown-fake,devices-fake,dir-sgid,protected-regular,xattrs-hlink,xattrs make check
44+
run: sudo RSYNC_EXPECT_SKIPPED=acls-default,chmod-temp-dir,chown-fake,devices-fake,dir-sgid,open-noatime,protected-regular,simd-checksum,xattrs-hlink,xattrs make check
4045
- name: ssl file list
4146
run: rsync-ssl --no-motd download.samba.org::rsyncftp/ || true
4247
- name: save artifact
43-
uses: actions/upload-artifact@v3
48+
uses: actions/upload-artifact@v4
4449
with:
4550
name: macos-bin
4651
path: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ aclocal.m4
5959
/auto-build-save
6060
.deps
6161
/*.exe
62+
*.dSYM/

Makefile.in

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ TLS_OBJ = tls.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/perms
5757

5858
# Programs we must have to run the test cases
5959
CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
60-
testrun$(EXEEXT) trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
60+
testrun$(EXEEXT) trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT) \
61+
simdtest$(EXEEXT)
6162

6263
CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test testsuite/xattrs-hlink.test
6364

@@ -312,20 +313,28 @@ test: check
312313

313314
.PHONY: check
314315
check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
315-
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
316+
$(srcdir)/runtests.py --rsync-bin=`pwd`/rsync$(EXEEXT)
316317

317318
.PHONY: check29
318319
check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
319-
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
320+
$(srcdir)/runtests.py --rsync-bin=`pwd`/rsync$(EXEEXT) --protocol=29
320321

321322
.PHONY: check30
322323
check30: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
323-
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=30
324+
$(srcdir)/runtests.py --rsync-bin=`pwd`/rsync$(EXEEXT) --protocol=30
324325

325326
wildtest.o: wildtest.c t_stub.o lib/wildmatch.c rsync.h config.h
326327
wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
327328
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
328329

330+
simdtest$(EXEEXT): simd-checksum-x86_64.cpp $(HEADERS)
331+
@if test x"@ROLL_SIMD@" != x; then \
332+
$(CXX) -I. $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -DTEST_SIMD_CHECKSUM1 \
333+
-o $@ $(srcdir)/simd-checksum-x86_64.cpp @ROLL_ASM@ $(LIBS); \
334+
else \
335+
touch $@; \
336+
fi
337+
329338
testsuite/chown-fake.test:
330339
ln -s chown.test $(srcdir)/testsuite/chown-fake.test
331340

@@ -341,7 +350,7 @@ testsuite/xattrs-hlink.test:
341350

342351
.PHONY: installcheck
343352
installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
344-
POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
353+
$(srcdir)/runtests.py --rsync-bin="$(bindir)/rsync$(EXEEXT)" --srcdir="$(srcdir)" --tooldir=`pwd`
345354

346355
# TODO: Add 'dist' target; need to know which files will be included
347356

NEWS.md

Lines changed: 134 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,141 @@
1-
# NEWS for rsync 3.4.2 (UNRELEASED)
1+
# NEWS for rsync 3.4.2 (28 Apr 2026)
22

33
## Changes in this version:
44

5+
### SECURITY RELATED:
6+
7+
Several security-relevant defects were reported and fixed since 3.4.1.
8+
None were assigned a CVE — rsync's fork-per-connection design scopes
9+
the impact of each of these to the attacker's own connection, which is
10+
equivalent to the client closing the socket itself — but they are
11+
fixed here as a matter of hygiene and to reduce the chances of a
12+
future exploitable combination. Many thanks to the external
13+
researchers who reported these issues.
14+
15+
- Fixed a signed integer overflow in the PROXY protocol v2 header
16+
parser: a negative `len` field could bypass the size check and cause
17+
a stack buffer overflow in `read_buf()`. Reported by John Walker of
18+
ZeroPath.
19+
20+
- Fixed an invalid access to the files array. Reported by Calum
21+
Hutton of Rapid7.
22+
23+
- Reject negative token values in the compressed-stream token
24+
decoder; a negative value could cause callers to misinterpret a
25+
missing data pointer as literal data. Reported by Will Sergeant.
26+
27+
- Fixed the element count passed to the xattr `qsort()` (see
28+
https://www.openwall.com/lists/oss-security/2026/04/16/2).
29+
30+
- Fixed a buffer underflow in `clean_fname()`, and added a regression
31+
test.
32+
33+
- Fixed an uninitialized `mul_one` in the AVX2 get_checksum1 path
34+
(undefined behaviour), and added a SIMD-checksum self-test that
35+
cross-checks SSE2, SSSE3 and AVX2 against the C reference on both
36+
aligned and unaligned buffers.
37+
38+
- Fixed an uninitialized `buf1` on the first call to
39+
`get_checksum2()` in the MD4 path (fixes #673).
40+
41+
- Zero all new memory from internal allocations: `my_alloc()` now uses
42+
`calloc`, and `expand_item_list()` zeros the expanded portion after
43+
`realloc`. This gives more predictable behaviour if stale or
44+
uninitialised memory is ever accidentally read.
45+
546
### BUG FIXES:
647

7-
- ...
48+
- Call `tzset()` before chroot so that log timestamps continue to
49+
reflect the configured local timezone after the daemon chroots
50+
(glibc needs `/etc/localtime`, which is unreachable post-chroot).
51+
52+
- Use the correct time when writing to the log file.
53+
54+
- Do not clear `DISPLAY` unconditionally.
55+
56+
- Fixed a Y2038 bug in `syscall.c` by replacing the `Int32x32To64`
57+
macro (which truncates its arguments to 32 bits) with a plain
58+
64-bit multiplication.
59+
60+
- Fixed ACL ID mapping for non-root users (closes #618).
61+
62+
- Fixed handling of objects with many xattrs on FreeBSD.
63+
64+
- Fixed `--open-noatime` not taking effect when opening regular
65+
files: `O_NOATIME` is now also passed to `do_open_nofollow()`, which
66+
has been used for regular files since the CVE fix "fixed symlink
67+
race condition in sender".
68+
69+
- Ignore "directory has vanished" errors.
70+
71+
- Fixed the removal of multiple leading slashes.
72+
73+
- Added the missing `--dirs` long option.
74+
75+
- Fixed a segfault if `poptGetContext()` returns NULL (e.g. under
76+
OOM) by not passing NULL to `poptReadDefaultConfig()`. Reported by
77+
Ronnie Sahlberg; found with `malloc-fail-tester`.
78+
79+
- Fixed a build error on ia64 NonStop (which treats missing
80+
prototypes as an error, not a warning).
81+
82+
- Fixed a flaky hardlinks test (fixes #735).
83+
84+
### ENHANCEMENTS:
85+
86+
- Added multi-threaded `zstd` compression, gated by a new
87+
`--compress-threads=N` option, with validation and man-page
88+
coverage.
89+
90+
- Documented the `temp dir` parameter in the rsyncd.conf man page
91+
(fixes #820).
92+
93+
- Improved rendering of interior dashes in long-option names in
94+
`md-convert` (perhaps fixes #686).
95+
96+
### PORTABILITY / BUILD:
97+
98+
- Fixed glibc 2.43 const-preserving overloads of `strtok()`,
99+
`strchr()` etc. by declaring the affected locals with the right
100+
constness. Contributed by Holger Hoffstätte.
101+
102+
- Converted the bundled zlib 1.2.8 from K&R-style function
103+
definitions to ANSI prototypes, so it builds with clang 16+.
104+
105+
- Avoid using `bool` as an identifier; it is a keyword in C23.
106+
107+
- `configure.ac`: check for xattr functions in libc first and only
108+
fall back to `-lattr`, avoiding spurious overlinking when `-lattr`
109+
happens to be installed. Contributed by Eli Schwartz.
110+
111+
- Made the build reproducible by honouring `SOURCE_DATE_EPOCH` for
112+
the manpage date.
113+
114+
- Removed obsolete `popt/findme.c` and `popt/findme.h` that upstream
115+
popt 1.14 folded into `popt.c` (fixes #710). Contributed by Alan
116+
Coopersmith.
117+
118+
### INTERNAL:
119+
120+
- Made many module-global variables `const` so they can live in
121+
`.rodata` and enable additional compiler optimization.
122+
123+
### DEVELOPER RELATED:
124+
125+
- Replaced `runtests.sh` with `runtests.py`, a Python test runner
126+
that supports `--valgrind` (with per-process log files so valgrind
127+
output no longer interferes with output comparisons) and
128+
`-j/--parallel` execution for roughly a 7× speed-up on typical
129+
hardware.
130+
131+
- Added a SIMD checksum self-test and a `clean-fname-underflow`
132+
regression test.
133+
134+
- Various CI fixes for macOS and Cygwin (including adding
135+
`simd-checksum` to the expected-skipped lists on platforms without
136+
SIMD), and tests now run on `ubuntu-latest`.
137+
138+
- removed support for the unmaintained rsync-patches archive
8139

9140
------------------------------------------------------------------------------
10141

@@ -4849,7 +4980,7 @@ to develop and test fixes.
48494980

48504981
| RELEASE DATE | VER. | DATE OF COMMIT\* | PROTOCOL |
48514982
|--------------|--------|------------------|-------------|
4852-
| ?? ??? 2025 | 3.4.2 | | 32 |
4983+
| 28 Apr 2026 | 3.4.2 | | 32 |
48534984
| 16 Jan 2025 | 3.4.1 | | 32 |
48544985
| 15 Jan 2025 | 3.4.0 | 15 Jan 2025 | 32 |
48554986
| 06 Apr 2024 | 3.3.0 | | 31 |

access.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void make_mask(char *mask, int plen, int addrlen)
9999
return;
100100
}
101101

102-
static int match_address(const char *addr, const char *tok)
102+
static int match_address(const char *addr, char *tok)
103103
{
104104
char *p;
105105
struct addrinfo hints, *resa, *rest;

acls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ static uchar recv_ida_entries(int f, ida_entries *ent)
713713
else
714714
id = recv_group_name(f, id, NULL);
715715
} else if (access & NAME_IS_USER) {
716-
if (inc_recurse && am_root && !numeric_ids)
716+
if (inc_recurse && !numeric_ids)
717717
id = match_uid(id);
718718
} else {
719719
if (inc_recurse && (!am_root || !numeric_ids))

batch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int *flag_ptr[] = {
7575
NULL
7676
};
7777

78-
static char *flag_name[] = {
78+
static const char *const flag_name[] = {
7979
"--recurse (-r)",
8080
"--owner (-o)",
8181
"--group (-g)",

checksum.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void parse_checksum_choice(int final_call)
176176
if (valid_checksums.negotiated_nni)
177177
xfer_sum_nni = file_sum_nni = valid_checksums.negotiated_nni;
178178
else {
179-
char *cp = checksum_choice ? strchr(checksum_choice, ',') : NULL;
179+
const char *cp = checksum_choice ? strchr(checksum_choice, ',') : NULL;
180180
if (cp) {
181181
xfer_sum_nni = parse_csum_name(checksum_choice, cp - checksum_choice);
182182
file_sum_nni = parse_csum_name(cp+1, -1);
@@ -366,9 +366,8 @@ void get_checksum2(char *buf, int32 len, char *sum)
366366

367367
mdfour_begin(&m);
368368

369-
if (len > len1) {
370-
if (buf1)
371-
free(buf1);
369+
if (len > len1 || !buf1) {
370+
free(buf1);
372371
buf1 = new_array(char, len+4);
373372
len1 = len;
374373
}

clientname.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ int read_proxy_protocol_header(int fd)
167167
char sig[PROXY_V2_SIG_SIZE];
168168
char ver_cmd;
169169
char fam;
170-
char len[2];
170+
unsigned char len[2];
171171
union {
172172
struct {
173173
char src_addr[4];

0 commit comments

Comments
 (0)