net-misc/rsync: Sync with Gentoo

It's from Gentoo commit 6c0727d0ce80cec3897d53aa5df250dea3744d2d.
This commit is contained in:
Flatcar Buildbot 2025-03-31 07:10:40 +00:00
parent 5511a2ba7b
commit 8bb7ab3afb
9 changed files with 40 additions and 344 deletions

View File

@ -1,4 +1,4 @@
DIST rsync-3.2.7.tar.gz 1149787 BLAKE2B 1b910b321e8d6b49af9f26bef813509f0da12dedd6857897de136d3617c68d38368ce05de13b9b0ef35a5452dca141ebdcdfb6af8456151d0ca0ad546452b504 SHA512 c2afba11a352fd88133f9e96e19d6df80eb864450c83eced13a7faa23df947bccf2ef093f2101df6ee30abff4cbbd39ac802e9aa5f726e42c9caff274fad8377
DIST rsync-3.2.7.tar.gz.asc 195 BLAKE2B d2bca9276d9a0c96a9156a8da60e391f58eceb2e1ffaa51b7e7ffd592feaba3ce54772bd563a251e3b30efb0ad07fc96da01158a77dd77c6534eac5d80b46e53 SHA512 bad9f48e033966566c6abf8cd485d35c0d9cf130eafb0c5fff9bcb928882283bbcdd2375e7c2880cf71cf81496ba6b743b61adca3d4678421c32915a2464acc3
DIST rsync-3.3.0.tar.gz 1153969 BLAKE2B 75a3cc50452086aebd16f42d7a309c173cbc1ea156227afb10d2106d0b9043e973676995b8199d22840775ae3df8db97d1c0de5f3aa58afa130c5b1348c3f825 SHA512 df5c53bc2f2b0e7e30f475903e5e4296dc2fbcf08e9ea6c3c61462d0e52b067c27e82deeb4be79102c86e9aa55a825182e126f22df44dabf5b7328acb2a01d10
DIST rsync-3.3.0.tar.gz.asc 195 BLAKE2B bd077217bd44d406ac49a55b0c0d38c2accd4867b9fbf78a13fe906f52e1773d5a69aa3116a0c245abdeb1af54705d6ffc75aaba8b276ba9229bbb3340d7c3e8 SHA512 611d26374e0ff98ffb11b6ad6555f08773b9f09e1fbf232abc73c5d472b0defd28fd559bd42707774204d055b93be289f19f4db94bbdfe0b0935918fd922cced
DIST rsync-3.4.1.tar.gz 1172739 BLAKE2B 79c1cad697547059ee241e20c26d7f97bed3ad062deb856d31a617fead333a2d9f62c7c47c1efaf70033dbc358fe547d034c35e8181abb51a1fc893557882bc7 SHA512 a3ecde4843ddb795308dca88581b868ac0221eb6f88a1477d7a9a2ecb4e4686042966bdddbab40866f90a4715d3104daa7b83222ddf0f3387b796a86bde8e5c2
DIST rsync-3.4.1.tar.gz.asc 862 BLAKE2B 5684bd57423e8e43b973c2c416c4897901a3a8b33c22690eaedc609109088e1d5d70f5cf5deaafefc69f547d198b5f8b17f3c484211d545095b19dac7e0bc7d3 SHA512 c83e187c88110b6119a023d239c76291f15124760fd245ead17e747424946e7864187aae96af6f5930cb84beff7308b99daa0566f306c9f2de51e2475704c320

View File

@ -1,21 +0,0 @@
https://github.com/WayneD/rsync/issues/427
https://github.com/WayneD/rsync/issues/429
https://github.com/WayneD/rsync/commit/90df93e446f9ebbfd4ce97d6755c5fe1f45f9fd0
From 90df93e446f9ebbfd4ce97d6755c5fe1f45f9fd0 Mon Sep 17 00:00:00 2001
From: Wayne Davison <wayne@opencoder.net>
Date: Sun, 8 Jan 2023 21:35:39 -0800
Subject: [PATCH] Don't call memcmp() on an empty lastdir.
--- a/flist.c
+++ b/flist.c
@@ -2367,7 +2367,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
}
dirlen = dir ? strlen(dir) : 0;
- if (dirlen != lastdir_len || memcmp(lastdir, dir, dirlen) != 0) {
+ if (dirlen != lastdir_len || (dirlen && memcmp(lastdir, dir, dirlen) != 0)) {
if (!change_pathname(NULL, dir, -dirlen))
goto bad_path;
lastdir = pathname;

View File

@ -1,54 +0,0 @@
https://bugs.gentoo.org/917517
https://github.com/WayneD/rsync/issues/511
https://bugzilla.suse.com/show_bug.cgi?id=1214249
https://bugzilla.redhat.com/show_bug.cgi?id=2229654
https://src.fedoraproject.org/rpms/rsync/raw/06d55616ec86c3a68a8af917783788b928fefcc4/f/rsync-3.2.7-buffer-overflow.patch
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;

View File

@ -1,32 +0,0 @@
https://github.com/WayneD/rsync/pull/558
From d869bcd3850b9a80f27f5aee4d41725f39d84ea7 Mon Sep 17 00:00:00 2001
From: Ivan Babrou <github@ivan.computer>
Date: Mon, 1 Jan 2024 19:31:01 -0800
Subject: [PATCH] configure.ac: fix failing IPv6 check due to missing return
type
Fixing this warning escalated to an error, resuting in no IPv6 support:
```
configure.sh:7679: checking whether to enable ipv6
configure.sh:7718: clang -o conftest -g -O2 -DHAVE_CONFIG_H -Wall -W conftest.c >&5
conftest.c:73:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
main()
^
int
1 error generated.
configure.sh:7718: $? = 1
configure.sh: program exited with status 1
```
--- a/configure.ac
+++ b/configure.ac
@@ -392,7 +392,7 @@ AS_HELP_STRING([--disable-ipv6],[disable to omit ipv6 support]),
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
-main()
+int main()
{
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);

View File

@ -0,0 +1,20 @@
https://github.com/RsyncProject/rsync/pull/716
From 026ef4cd09660c0a096e285e668b4ba7cd396509 Mon Sep 17 00:00:00 2001
From: Michal Ruprich <mruprich@redhat.com>
Date: Fri, 17 Jan 2025 12:37:57 +0100
Subject: [PATCH] bool is a keyword in C23
--- a/wildtest.c
+++ b/wildtest.c
@@ -32,7 +32,9 @@ int fnmatch_errors = 0;
int wildmatch_errors = 0;
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
typedef char bool;
+#endif
int output_iterations = 0;
int explode_mod = 0;

View File

@ -1,15 +0,0 @@
# /etc/rsyncd.conf
# Minimal configuration file for rsync daemon
# See rsync(1) and rsyncd.conf(5) man pages for help
# This line is required by the /etc/init.d/rsyncd script
pid file = @GENTOO_PORTAGE_EPREFIX@/run/rsyncd.pid
use chroot = yes
read only = yes
# Simple example for enabling your own local rsync server
#[gentoo-portage]
# path = @GENTOO_PORTAGE_EPREFIX@/var/db/repos/gentoo
# comment = Gentoo ebuild repository
# exclude = /distfiles /packages

View File

@ -1,207 +0,0 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# Uncomment when introducing a patch which touches configure
RSYNC_NEEDS_AUTOCONF=1
PYTHON_COMPAT=( python3_{9..11} )
inherit flag-o-matic prefix python-single-r1 systemd
DESCRIPTION="File transfer program to keep remote files into sync"
HOMEPAGE="https://rsync.samba.org/"
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/WayneD/rsync.git"
inherit autotools git-r3
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
else
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/waynedavison.asc
inherit verify-sig
if [[ -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then
inherit autotools
fi
if [[ ${PV} == *_pre* ]] ; then
SRC_DIR="src-previews"
else
SRC_DIR="src"
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
SRC_URI="https://rsync.samba.org/ftp/rsync/${SRC_DIR}/${P/_/}.tar.gz
verify-sig? ( https://rsync.samba.org/ftp/rsync/${SRC_DIR}/${P/_/}.tar.gz.asc )"
S="${WORKDIR}"/${P/_/}
fi
LICENSE="GPL-3"
SLOT="0"
IUSE="acl examples iconv lz4 rrsync ssl stunnel system-zlib xattr xxhash zstd"
REQUIRED_USE+=" examples? ( ${PYTHON_REQUIRED_USE} )"
REQUIRED_USE+=" rrsync? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND="
>=dev-libs/popt-1.5
acl? ( virtual/acl )
examples? (
${PYTHON_DEPS}
dev-lang/perl
)
lz4? ( app-arch/lz4:= )
rrsync? (
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/bracex[${PYTHON_USEDEP}]
')
)
ssl? ( dev-libs/openssl:= )
system-zlib? ( sys-libs/zlib )
xattr? ( kernel_linux? ( sys-apps/attr ) )
xxhash? ( >=dev-libs/xxhash-0.8 )
zstd? ( >=app-arch/zstd-1.4:= )
iconv? ( virtual/libiconv )"
DEPEND="${RDEPEND}"
BDEPEND="
examples? ( ${PYTHON_DEPS} )
rrsync? ( ${PYTHON_DEPS} )
"
if [[ ${PV} == *9999 ]] ; then
BDEPEND+=" ${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/commonmark[${PYTHON_USEDEP}]
')"
else
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-waynedavison )"
fi
PATCHES=(
"${FILESDIR}"/${P}-flist-memcmp-ub.patch
"${FILESDIR}"/${P}-fortify-source-3.patch
"${FILESDIR}"/${PN}-3.2.7-ipv6-configure-c99.patch
)
pkg_setup() {
# - USE=examples needs Python itself at runtime, but nothing else
# - 9999 needs commonmark at build time
if [[ ${PV} == *9999 ]] || use examples || use rrsync; then
python-single-r1_pkg_setup
fi
}
src_prepare() {
default
sed -i -e 's/AC_HEADER_MAJOR_FIXED/AC_HEADER_MAJOR/' configure.ac
if [[ ${PV} == *9999 || -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then
eaclocal -I m4
eautoconf -o configure.sh
eautoheader && touch config.h.in
fi
if use examples || use rrsync; then
python_fix_shebang support/
fi
if [[ -f rrsync.1 ]]; then
# If the pre-build rrsync.1 man page exists, then link to it
# from support/rrsync.1 to avoid rsync's build system attempting
# re-creating the man page (bug #883049).
ln -s ../rrsync.1 support/rrsync.1 || die
fi
}
src_configure() {
local myeconfargs=(
--with-rsyncd-conf="${EPREFIX}"/etc/rsyncd.conf
--without-included-popt
--enable-ipv6
$(use_enable acl acl-support)
$(use_enable iconv)
$(use_enable lz4)
$(use_with rrsync)
$(use_enable ssl openssl)
$(use_with !system-zlib included-zlib)
$(use_enable xattr xattr-support)
$(use_enable xxhash)
$(use_enable zstd)
)
# https://github.com/WayneD/rsync/pull/428
if is-flagq -fsanitize=undefined ; then
sed -E -i \
-e 's:#define CAREFUL_ALIGNMENT (0|1):#define CAREFUL_ALIGNMENT 1:' \
byteorder.h || die
append-flags -DCAREFUL_ALIGNMENT
fi
econf "${myeconfargs[@]}"
}
src_install() {
emake DESTDIR="${D}" install
newconfd "${FILESDIR}"/rsyncd.conf.d rsyncd
newinitd "${FILESDIR}"/rsyncd.init.d-r1 rsyncd
dodoc NEWS.md README.md TODO tech_report.tex
insinto /etc
newins "${FILESDIR}"/rsyncd.conf-3.2.7-r5 rsyncd.conf
insinto /etc/logrotate.d
newins "${FILESDIR}"/rsyncd.logrotate rsyncd
insinto /etc/xinetd.d
newins "${FILESDIR}"/rsyncd.xinetd-3.0.9-r1 rsyncd
# Install stunnel helpers
if use stunnel ; then
emake DESTDIR="${D}" install-ssl-daemon
fi
# Install the useful contrib scripts
if use examples ; then
# The 'rrsync' script is installed conditionally via the 'rrysnc'
# USE flag, and not via the 'examples' USE flag.
rm support/rrsync* || die
exeinto /usr/share/rsync
doexe support/*
rm -f "${ED}"/usr/share/rsync/{Makefile*,*.c}
fi
eprefixify "${ED}"/etc/{,xinetd.d}/rsyncd*
systemd_newunit packaging/systemd/rsync.service rsyncd.service
}
pkg_postinst() {
if grep -Eqis '^[[:space:]]use chroot[[:space:]]*=[[:space:]]*(no|0|false)' \
"${EROOT}"/etc/rsyncd.conf "${EROOT}"/etc/rsync/rsyncd.conf ; then
ewarn "You have disabled chroot support in your rsyncd.conf. This"
ewarn "is a security risk which you should fix. Please check your"
ewarn "/etc/rsyncd.conf file and fix the setting 'use chroot'."
fi
if use stunnel ; then
einfo "Please install \">=net-misc/stunnel-4\" in order to use stunnel feature."
einfo
einfo "You maybe have to update the certificates configured in"
einfo "${EROOT}/etc/stunnel/rsync.conf"
fi
if use system-zlib ; then
ewarn "Using system-zlib is incompatible with <rsync-3.1.1 when"
ewarn "using the --compress option."
ewarn
ewarn "When syncing with >=rsync-3.1.1 built with bundled zlib,"
ewarn "and the --compress option, add --new-compress (-zz)."
ewarn
ewarn "For syncing the portage tree, add:"
ewarn "PORTAGE_RSYNC_EXTRA_OPTS=\"--new-compress\" to make.conf"
fi
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -16,7 +16,7 @@ if [[ ${PV} == *9999 ]] ; then
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
else
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/waynedavison.asc
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/andrewtridgell.asc
inherit verify-sig
if [[ -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then
@ -27,7 +27,7 @@ else
SRC_DIR="src-previews"
else
SRC_DIR="src"
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
SRC_URI="https://rsync.samba.org/ftp/rsync/${SRC_DIR}/${P/_/}.tar.gz
@ -42,7 +42,7 @@ REQUIRED_USE+=" examples? ( ${PYTHON_REQUIRED_USE} )"
REQUIRED_USE+=" rrsync? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND="
>=dev-libs/popt-1.5
>=dev-libs/popt-1.19
acl? ( virtual/acl )
examples? (
${PYTHON_DEPS}
@ -73,9 +73,13 @@ if [[ ${PV} == *9999 ]] ; then
dev-python/commonmark[${PYTHON_USEDEP}]
')"
else
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-waynedavison )"
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-andrewtridgell )"
fi
PATCHES=(
"${FILESDIR}"/${PN}-3.4.1-c23.patch
)
pkg_setup() {
# - USE=examples needs Python itself at runtime, but nothing else
# - 9999 needs commonmark at build time
@ -108,9 +112,6 @@ src_prepare() {
}
src_configure() {
# Should be fixed upstream in next release (>3.3.0) (bug #943745)
append-cflags $(test-flags-CC -std=gnu17)
local myeconfargs=(
--with-rsyncd-conf="${EPREFIX}"/etc/rsyncd.conf
--without-included-popt

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -16,7 +16,7 @@ if [[ ${PV} == *9999 ]] ; then
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
else
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/waynedavison.asc
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/andrewtridgell.asc
inherit verify-sig
if [[ -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then
@ -42,7 +42,7 @@ REQUIRED_USE+=" examples? ( ${PYTHON_REQUIRED_USE} )"
REQUIRED_USE+=" rrsync? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND="
>=dev-libs/popt-1.5
>=dev-libs/popt-1.19
acl? ( virtual/acl )
examples? (
${PYTHON_DEPS}
@ -73,9 +73,13 @@ if [[ ${PV} == *9999 ]] ; then
dev-python/commonmark[${PYTHON_USEDEP}]
')"
else
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-waynedavison )"
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-andrewtridgell )"
fi
PATCHES=(
"${FILESDIR}"/${PN}-3.4.1-c23.patch
)
pkg_setup() {
# - USE=examples needs Python itself at runtime, but nothing else
# - 9999 needs commonmark at build time
@ -143,7 +147,7 @@ src_install() {
dodoc NEWS.md README.md TODO tech_report.tex
insinto /etc
newins "${FILESDIR}"/rsyncd.conf-3.0.9-r1 rsyncd.conf
newins "${FILESDIR}"/rsyncd.conf-3.2.7-r5 rsyncd.conf
insinto /etc/logrotate.d
newins "${FILESDIR}"/rsyncd.logrotate rsyncd