From 8abf3c4da405ce6be54967de8615574dd863b357 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 May 2026 08:32:03 +0000 Subject: [PATCH 1/4] Updated dependency 'rsync' from version 3.4.2 to 3.4.3 --- deps-packaging/rsync/cfbuild-rsync.spec | 2 +- deps-packaging/rsync/distfiles | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps-packaging/rsync/cfbuild-rsync.spec b/deps-packaging/rsync/cfbuild-rsync.spec index 9bd68eaaa..e66605fb7 100644 --- a/deps-packaging/rsync/cfbuild-rsync.spec +++ b/deps-packaging/rsync/cfbuild-rsync.spec @@ -1,4 +1,4 @@ -%define rsync_version 3.4.2 +%define rsync_version 3.4.3 Summary: CFEngine Build Automation -- rsync Name: cfbuild-rsync diff --git a/deps-packaging/rsync/distfiles b/deps-packaging/rsync/distfiles index ffbf276fc..2d0543c64 100644 --- a/deps-packaging/rsync/distfiles +++ b/deps-packaging/rsync/distfiles @@ -1 +1 @@ -ff10aa2c151cd4b2dbbe6135126dbc854046113d2dfb49572a348233267eb315 rsync-3.4.2.tar.gz +c72e63ca3021cbc80ba86ec30102773f4c5631fbc492b52e773b3958f82a53d3 rsync-3.4.3.tar.gz From 6801371801bd74ed7b2778866feedee84b6b5c65 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Wed, 27 May 2026 15:53:35 +0200 Subject: [PATCH 2/4] rsync: patch syscall.c to define SYS_openat2 when missing Some kernel-headers packages ship but do not export SYS_openat2 from , causing rsync 3.4.3's syscall.c to fail to compile: syscall.c: In function 'secure_relative_open_linux': syscall.c:1723:19: error: 'SYS_openat2' undeclared (first use in this function); did you mean 'SYS_openat'? 1723 | dirfd = syscall(SYS_openat2, AT_FDCWD, basedir, &bhow, sizeof bhow); | ^~~~~~~~~~~ | SYS_openat Apply a source patch that adds a fallback #define SYS_openat2 437 (the syscall number is the same on all Linux architectures). Signed-off-by: Lars Erik Wik --- deps-packaging/rsync/cfbuild-rsync.spec | 5 ++++- deps-packaging/rsync/debian/rules | 2 ++ .../rsync/fix-sys-openat2-undeclared.patch | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 deps-packaging/rsync/fix-sys-openat2-undeclared.patch diff --git a/deps-packaging/rsync/cfbuild-rsync.spec b/deps-packaging/rsync/cfbuild-rsync.spec index e66605fb7..c32dd1a04 100644 --- a/deps-packaging/rsync/cfbuild-rsync.spec +++ b/deps-packaging/rsync/cfbuild-rsync.spec @@ -5,6 +5,7 @@ Name: cfbuild-rsync Version: %{version} Release: 1 Source0: rsync-%{rsync_version}.tar.gz +Patch0: fix-sys-openat2-undeclared.patch License: MIT Group: Other Url: https://cfengine.com @@ -18,6 +19,8 @@ AutoReqProv: no mkdir -p %{_builddir} %setup -q -n rsync-%{rsync_version} +%patch -P 0 -p1 + # liblz4, libxxhash, libzstd, and libssl give rsync extra compression # algorithms, extra checksum algorithms, and allow use of openssl's crypto lib # for (potentially) faster MD4/MD5 checksums. @@ -25,7 +28,7 @@ mkdir -p %{_builddir} %build -make +make %install diff --git a/deps-packaging/rsync/debian/rules b/deps-packaging/rsync/debian/rules index b6c38a195..09ab68032 100755 --- a/deps-packaging/rsync/debian/rules +++ b/deps-packaging/rsync/debian/rules @@ -12,6 +12,8 @@ build: build-stamp build-stamp: dh_testdir + patch -p1 < $(CURDIR)/fix-sys-openat2-undeclared.patch + # liblz4, libxxhash, libzstd, and libssl give rsync extra compression # algorithms, extra checksum algorithms, and allow use of openssl's crypto # lib for (potentially) faster MD4/MD5 checksums. diff --git a/deps-packaging/rsync/fix-sys-openat2-undeclared.patch b/deps-packaging/rsync/fix-sys-openat2-undeclared.patch new file mode 100644 index 000000000..f839dd09e --- /dev/null +++ b/deps-packaging/rsync/fix-sys-openat2-undeclared.patch @@ -0,0 +1,16 @@ +Fall back to defining SYS_openat2 when the running kernel-headers don't +export it from . See https://github.com/RsyncProject/rsync/issues/900. +The syscall number 437 is correct for all Linux architectures. + +--- a/syscall.c ++++ b/syscall.c +@@ -37,6 +37,9 @@ + #ifdef __linux__ + #include + #include ++#ifndef SYS_openat2 ++#define SYS_openat2 437 ++#endif + #endif + + #include "ifuncs.h" From 4c636d1bc22d73504d5f8109902c394409ecab5f Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 1 Jun 2026 12:01:21 +0200 Subject: [PATCH 3/4] detect-environment: add OS_VERSION_MAJOR variable Manually cherry-picked the detect-environment portion of commit b550647a ("Added a shell variable for the OS major version") from master; the full commit does not apply cleanly to this branch. Co-authored-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com> Signed-off-by: Lars Erik Wik --- build-scripts/detect-environment | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-scripts/detect-environment b/build-scripts/detect-environment index 6b3a14e68..69671fd4d 100644 --- a/build-scripts/detect-environment +++ b/build-scripts/detect-environment @@ -72,7 +72,12 @@ detect_os() exit 42;; esac - export OS OS_VERSION + # Extract major version from OS_VERSION (e.g. 16.04 -> 16, 7.0 -> 7, 10.2.3 -> 10) + if [ -n "$OS_VERSION" ]; then + OS_VERSION_MAJOR="${OS_VERSION%%.*}" + fi + + export OS OS_VERSION OS_VERSION_MAJOR } detect_distribution() From 166f40bd1026870881459c7ed745045b08b33374 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 1 Jun 2026 12:03:12 +0200 Subject: [PATCH 4/4] rsync: inline openat2.h where the header is missing RHEL/CentOS 7 and Ubuntu 20.04 ship kernel-headers without , so rsync 3.4.3's unconditional include fails before the existing SYS_openat2 fallback can take effect. Add a second patch that inlines the header verbatim, applied only on those platforms via $OS / $OS_VERSION_MAJOR; everything else keeps using fix-sys-openat2-undeclared.patch. Signed-off-by: Lars Erik Wik --- deps-packaging/rsync/cfbuild-rsync.spec | 9 ++- deps-packaging/rsync/debian/rules | 8 ++- .../rsync/fix-missing-openat2-header.patch | 62 +++++++++++++++++++ 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 deps-packaging/rsync/fix-missing-openat2-header.patch diff --git a/deps-packaging/rsync/cfbuild-rsync.spec b/deps-packaging/rsync/cfbuild-rsync.spec index c32dd1a04..cfe5de28d 100644 --- a/deps-packaging/rsync/cfbuild-rsync.spec +++ b/deps-packaging/rsync/cfbuild-rsync.spec @@ -6,6 +6,7 @@ Version: %{version} Release: 1 Source0: rsync-%{rsync_version}.tar.gz Patch0: fix-sys-openat2-undeclared.patch +Patch1: fix-missing-openat2-header.patch License: MIT Group: Other Url: https://cfengine.com @@ -19,7 +20,13 @@ AutoReqProv: no mkdir -p %{_builddir} %setup -q -n rsync-%{rsync_version} -%patch -P 0 -p1 +# RHEL/CentOS 7's kernel-headers lack ; inline the header +# there. Other platforms only need the SYS_openat2 fallback. +if { [ "$OS" = rhel ] || [ "$OS" = centos ]; } && [ "$OS_VERSION_MAJOR" = 7 ]; then + patch -p1 < %{_sourcedir}/fix-missing-openat2-header.patch +else + patch -p1 < %{_sourcedir}/fix-sys-openat2-undeclared.patch +fi # liblz4, libxxhash, libzstd, and libssl give rsync extra compression # algorithms, extra checksum algorithms, and allow use of openssl's crypto lib diff --git a/deps-packaging/rsync/debian/rules b/deps-packaging/rsync/debian/rules index 09ab68032..e80e10339 100755 --- a/deps-packaging/rsync/debian/rules +++ b/deps-packaging/rsync/debian/rules @@ -12,7 +12,13 @@ build: build-stamp build-stamp: dh_testdir - patch -p1 < $(CURDIR)/fix-sys-openat2-undeclared.patch + # Ubuntu 20.04's kernel-headers lack ; inline the + # header there. Other platforms only need the SYS_openat2 fallback. + if [ "$$OS" = ubuntu ] && [ "$$OS_VERSION_MAJOR" = 20 ]; then \ + patch -p1 < $(CURDIR)/fix-missing-openat2-header.patch; \ + else \ + patch -p1 < $(CURDIR)/fix-sys-openat2-undeclared.patch; \ + fi # liblz4, libxxhash, libzstd, and libssl give rsync extra compression # algorithms, extra checksum algorithms, and allow use of openssl's crypto diff --git a/deps-packaging/rsync/fix-missing-openat2-header.patch b/deps-packaging/rsync/fix-missing-openat2-header.patch new file mode 100644 index 000000000..c34a5321c --- /dev/null +++ b/deps-packaging/rsync/fix-missing-openat2-header.patch @@ -0,0 +1,62 @@ +RHEL 7 and Ubuntu 20.04 ship kernel-headers that lack +entirely, so rsync 3.4.3's unconditional include fails to compile. Inline the +header verbatim on these platforms. SYS_openat2 (437 on all Linux +architectures) is likewise absent there. On pre-5.6 kernels openat2 returns +ENOSYS and rsync falls back to the portable per-component open. + +This patch is applied only on RHEL 7 / Ubuntu 20.04 (see the spec and +debian/rules); other platforms use fix-sys-openat2-undeclared.patch. + +--- a/syscall.c ++++ b/syscall.c +@@ -36,4 +36,49 @@ + #ifdef __linux__ + #include +-#include ++/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ ++#ifndef _LINUX_OPENAT2_H ++#define _LINUX_OPENAT2_H ++ ++#include ++ ++/* ++ * Arguments for how openat2(2) should open the target path. If only @flags and ++ * @mode are non-zero, then openat2(2) operates very similarly to openat(2). ++ * ++ * However, unlike openat(2), unknown or invalid bits in @flags result in ++ * -EINVAL rather than being silently ignored. @mode must be zero unless one of ++ * {O_CREAT, O_TMPFILE} are set. ++ * ++ * @flags: O_* flags. ++ * @mode: O_CREAT/O_TMPFILE file mode. ++ * @resolve: RESOLVE_* flags. ++ */ ++struct open_how { ++ __u64 flags; ++ __u64 mode; ++ __u64 resolve; ++}; ++ ++/* how->resolve flags for openat2(2). */ ++#define RESOLVE_NO_XDEV 0x01 /* Block mount-point crossings ++ (includes bind-mounts). */ ++#define RESOLVE_NO_MAGICLINKS 0x02 /* Block traversal through procfs-style ++ "magic-links". */ ++#define RESOLVE_NO_SYMLINKS 0x04 /* Block traversal through all symlinks ++ (implies OEXT_NO_MAGICLINKS) */ ++#define RESOLVE_BENEATH 0x08 /* Block "lexical" trickery like ++ "..", symlinks, and absolute ++ paths which escape the dirfd. */ ++#define RESOLVE_IN_ROOT 0x10 /* Make all jumps to "/" and ".." ++ be scoped inside the dirfd ++ (similar to chroot(2)). */ ++#define RESOLVE_CACHED 0x20 /* Only complete if resolution can be ++ completed through cached lookup. May ++ return -EAGAIN if that's not ++ possible. */ ++ ++#endif /* _LINUX_OPENAT2_H */ ++#ifndef SYS_openat2 ++#define SYS_openat2 437 ++#endif + #endif