From 1f1d7d48bb1c8f62b314a549713121b468f0063b 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 4b1ebbe85..632a10b2f 100755 --- a/build-scripts/prepare-testmachine-chroot +++ b/build-scripts/prepare-testmachine-chroot @@ -56,6 +56,13 @@ if [ $RETURN_CODE -ne 0 ] && [ $RETURN_CODE -ne 24 ]; then exit $RETURN_CODE fi +# 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 + # Create and set permissions for essential directories inside chroot for d in tmp var/tmp run root; do sudo mkdir -p "${CHROOT_ROOT}${d}"