From 5d4cff2ca3c06a8efee8d8e87e2989962b7d2195 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 2 Oct 2026 10:57:01 +0200 Subject: [PATCH] Fixed device file modes in test machine chroot Since https://github.com/RsyncProject/rsync/commit/808daef3e9a7 rsync skips chmod on device files when no symlink-safe chmod is available (glibc < 2.32 and kernel < 6.6). This left /dev/null in the chroot unwritable for non-root users on RHEL 8 with rsync 3.1.3-28.el8_10. Now copies the device file modes from the host. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lars Erik Wik (cherry picked from commit 462ce29c25c547d5320ad723740c9b128b9272f6) --- build-scripts/prepare-testmachine-chroot | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-scripts/prepare-testmachine-chroot b/build-scripts/prepare-testmachine-chroot index af0bae063..4f0804a05 100755 --- a/build-scripts/prepare-testmachine-chroot +++ b/build-scripts/prepare-testmachine-chroot @@ -38,6 +38,13 @@ sudo mkdir -p ${CHROOT_ROOT}run sudo mkdir -p ${CHROOT_ROOT}root +# rsync may skip chmod on device files since this patch, so copy the modes +# from the host: https://github.com/RsyncProject/rsync/commit/808daef3e9a7 +if [ "$OS_FAMILY" = linux ]; then + (cd /dev && sudo find . -xdev \( -type c -o -type b \) \ + -exec chmod --reference=/dev/{} "${CHROOT_ROOT}dev/{}" \;) +fi + # Safeguard to terminate operation if we have somehow ended up outside the # chroot, so we don't start running unsafe tests there. sudo touch ${CHROOT_ROOT}inside-chroot.txt