Make sure no 32 bit binaries will be found as our fakeroot only supports 64 bit.
If a 32 bit binary is run under fakeroot it will error out with wrong ELF class.
--- rsync-3.4.2/testsuite/rsync.fns.orig	2026-04-22 04:34:39.000000000 +0200
+++ rsync-3.4.2/testsuite/rsync.fns	2026-04-28 22:06:09.711570876 +0200
@@ -32,7 +32,7 @@
 tab_ch='	' # a single tab character
 
 # Berkley's nice.
-PATH="$PATH:/usr/ucb"
+PATH="$PATH"
 
 if diff -u "$suitedir/rsync.fns" "$suitedir/rsync.fns" >/dev/null 2>&1; then
     diffopt="-u"
@@ -69,11 +69,11 @@
 	set_cp_destdir "${@}" # sets destdir var
 	while test $# -gt 1; do
 	    destname="$destdir/`basename $1`"
-	    touch -r "$destname" "$1" "$destname"
+	    gtouch -r "$destname" "$1" "$destname"
 	    shift
 	done
     else
-	touch -r "$2" "$1" "$2"
+	gtouch -r "$2" "$1" "$2"
     fi
 }
 
@@ -81,7 +81,7 @@
 # -vv) from an rsync run (whittling the output down to just the file messages).
 # This isn't needed if you use -i without -v.
 v_filt() {
-    sed -e '/^building file list /d' \
+    gsed -e '/^building file list /d' \
 	-e '/^sending incremental file list/d' \
 	-e '/^created directory /d' \
 	-e '/^done$/d' \
@@ -97,20 +97,20 @@
 }
 
 rsync_ls_lR() {
-    find "$@" -name .git -prune -o -name auto-build-save -prune -o -name testtmp -prune -o -print | \
-	sort | sed 's/ /\\ /g' | xargs "$TOOLDIR/tls" $TLS_ARGS
+    gfind "$@" -name .git -prune -o -name auto-build-save -prune -o -name testtmp -prune -o -print | \
+	gsort | gsed 's/ /\\ /g' | gxargs "$TOOLDIR/tls" $TLS_ARGS
 }
 
 get_testuid() {
-    uid=`id -u 2>/dev/null || true`
+    uid=`gid -u 2>/dev/null || true`
     case "$uid" in
 	[0-9]*) echo "$uid" ;;
-	*) id 2>/dev/null | sed 's/^[^0-9]*\([0-9][0-9]*\).*/\1/' ;;
+	*) gid 2>/dev/null | gsed 's/^[^0-9]*\([0-9][0-9]*\).*/\1/' ;;
     esac
 }
 
 get_rootuid() {
-    uid=`id -u root 2>/dev/null || true`
+    uid=`gid -u root 2>/dev/null || true`
     case "$uid" in
 	[0-9]*) echo "$uid" ;;
 	*) echo 0 ;;
@@ -118,7 +118,7 @@
 }
 
 get_rootgid() {
-    gid=`id -g root 2>/dev/null || true`
+    gid=`gid -g root 2>/dev/null || true`
     case "$gid" in
 	[0-9]*) echo "$gid" ;;
 	*) echo 0 ;;
@@ -131,8 +131,8 @@
 # user than the (admin) user running the tests.
 cp_cmd="cp -p"
 if test x`get_testuid` != x0; then
-    case `cp --help 2>/dev/null` in
-	*--no-preserve=*) cp_cmd="cp -p --no-preserve=ownership" ;;
+    case `gcp --help 2>/dev/null` in
+	*--no-preserve=*) cp_cmd="gcp -p --no-preserve=ownership" ;;
     esac
 fi
 cp_p() {
@@ -140,7 +140,7 @@
 }
 
 check_perms() {
-    perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'`
+    perms=`"$TOOLDIR/tls" "$1" | gsed 's/^[-d]\(.........\).*/\1/'`
     if test $perms = $2; then
 	return 0
     fi
@@ -159,12 +159,12 @@
 
 hands_setup() {
     # Clean before creation
-    rm -rf "$fromdir"
-    rm -rf "$todir"
+    grm -rf "$fromdir"
+    grm -rf "$todir"
 
-    [ -d "$tmpdir" ] || mkdir "$tmpdir"
-    [ -d "$fromdir" ] || mkdir "$fromdir"
-    [ -d "$todir" ] || mkdir "$todir"
+    [ -d "$tmpdir" ] || gmkdir "$tmpdir"
+    [ -d "$fromdir" ] || gmkdir "$fromdir"
+    [ -d "$todir" ] || gmkdir "$todir"
 
     # On some BSD systems, the umask affects the mode of created
     # symlinks, even though the mode apparently has no effect on how
@@ -177,33 +177,33 @@
     # the same.  So, we need to set our umask before doing any creations.
 
     # set up test data
-    touch "$fromdir/empty"
-    mkdir "$fromdir/emptydir"
+    gtouch "$fromdir/empty"
+    gmkdir "$fromdir/emptydir"
 
     # a hundred lines of text or so
     rsync_ls_lR "$srcdir" > "$fromdir/filelist"
 
     echo $ECHO_N "This file has no trailing lf$ECHO_C" > "$fromdir/nolf"
     umask 0
-    ln -s nolf "$fromdir/nolf-symlink"
+    gln -s nolf "$fromdir/nolf-symlink"
     umask 022
 
-    cat "$srcdir"/*.c > "$fromdir/text"
-    mkdir "$fromdir/dir"
-    cp "$fromdir/text" "$fromdir/dir"
-    mkdir "$fromdir/dir/subdir"
+    gcat "$srcdir"/*.c > "$fromdir/text"
+    gmkdir "$fromdir/dir"
+    gcp "$fromdir/text" "$fromdir/dir"
+    gmkdir "$fromdir/dir/subdir"
     echo some data > "$fromdir/dir/subdir/foobar.baz"
-    mkdir "$fromdir/dir/subdir/subsubdir"
+    gmkdir "$fromdir/dir/subdir/subsubdir"
     if [ -r /etc ]; then
-	ls -ltr /etc > "$fromdir/dir/subdir/subsubdir/etc-ltr-list" || [ $? -eq 1 ]
+	gls -ltr /etc > "$fromdir/dir/subdir/subsubdir/etc-ltr-list" || [ $? -eq 1 ]
     else
-	ls -ltr / > "$fromdir/dir/subdir/subsubdir/etc-ltr-list" || [ $? -eq 1 ]
+	gls -ltr / > "$fromdir/dir/subdir/subsubdir/etc-ltr-list" || [ $? -eq 1 ]
     fi
-    mkdir "$fromdir/dir/subdir/subsubdir2"
+    gmkdir "$fromdir/dir/subdir/subsubdir2"
     if [ -r /bin ]; then
 	ls -lt /bin > "$fromdir/dir/subdir/subsubdir2/bin-lt-list" || [ $? -eq 1 ]
     else
-	ls -lt / > "$fromdir/dir/subdir/subsubdir2/bin-lt-list" || [ $? -eq 1 ]
+	gls -lt / > "$fromdir/dir/subdir/subsubdir2/bin-lt-list" || [ $? -eq 1 ]
     fi
 
 #      echo testing head:
@@ -219,13 +219,13 @@
 	(echo "        makepath $p"
 
 	# Absolute Unix path.
-	if echo $p | grep '^/' >/dev/null; then
+	if echo $p | ggrep '^/' >/dev/null; then
 	    cd /
 	fi
 
 	# This will break if $p contains a space.
-	for c in `echo $p | tr '/' ' '`; do
-	    if [ -d "$c" ] || mkdir "$c"; then
+	for c in `echo $p | gtr '/' ' '`; do
+	    if [ -d "$c" ] || gmkdir "$c"; then
 		cd "$c" || return $?
 	    else
 		echo "failed to create $c" >&2; return $?
@@ -277,7 +277,7 @@
     echo "check how the directory listings compare with diff:"
     echo ""
     ( cd "$3" && rsync_ls_lR . ) > "$tmpdir/ls-to"
-    diff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed="$failed dir-diff"
+    gdiff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed="$failed dir-diff"
 
     echo "-------------"
     echo "check how the files compare with diff:"
@@ -285,7 +285,7 @@
     if [ "x$4" != x ]; then
 	echo "  === Skipping (as directed) ==="
     else
-	diff -r $diffopt "$2" "$3" || failed="$failed file-diff"
+	gdiff -r $diffopt "$2" "$3" || failed="$failed file-diff"
     fi
 
     echo "-------------"
@@ -304,7 +304,7 @@
     echo "Running: \"$1\""
     eval "$1" >"$outfile"
     status=$?
-    cat "$outfile"
+    gcat "$outfile"
     if [ $status != 0 ]; then
 	echo "Failed: status=$status"
 	return 1
@@ -315,7 +315,7 @@
 
 # Slurp stdin into $chkfile and then call checkdiff2().
 checkdiff() {
-    cat >"$chkfile" # Save off stdin
+    gcat >"$chkfile" # Save off stdin
     checkdiff2 "${@}"
 }
 
@@ -329,17 +329,17 @@
     echo "Running: \"$1\""
     eval "$1" >"$outfile"
     status=$?
-    cat "$outfile"
+    gcat "$outfile"
     if [ $status != 0 ]; then
 	failed="$failed status=$status"
     fi
 
     if [ -n "$2" ]; then
 	eval "cat '$outfile' | $2 >'$outfile.new'"
-	mv "$outfile.new" "$outfile"
+	gmv "$outfile.new" "$outfile"
     fi
 
-    diff $diffopt "$chkfile" "$outfile" || failed="$failed output differs"
+    gdiff $diffopt "$chkfile" "$outfile" || failed="$failed output differs"
 
     if [ -n "$failed" ]; then
 	echo "Failed:$failed"
@@ -372,7 +372,7 @@
 	gid_setting="#$gid_setting"
     fi
 
-    cat >"$conf" <<EOF
+    gcat >"$conf" <<EOF
 # rsyncd configuration file autogenerated by $0
 
 pid file = $pidfile
@@ -432,12 +432,12 @@
 
 
 build_symlinks() {
-    mkdir "$fromdir"
-    date >"$fromdir/referent"
-    ln -s referent "$fromdir/relative"
-    ln -s "$fromdir/referent" "$fromdir/absolute"
-    ln -s nonexistent "$fromdir/dangling"
-    ln -s "$srcdir/rsync.c" "$fromdir/unsafe"
+    gmkdir "$fromdir"
+    gdate >"$fromdir/referent"
+    gln -s referent "$fromdir/relative"
+    gln -s "$fromdir/referent" "$fromdir/absolute"
+    gln -s nonexistent "$fromdir/dangling"
+    gln -s "$srcdir/rsync.c" "$fromdir/unsafe"
 }
 
 test_fail() {
@@ -460,8 +460,8 @@
 }
 
 # Determine what shell command will appropriately test for links.
-ln -s foo "$scratchdir/testlink"
-for cmd in test /bin/test /usr/bin/test /usr/ucb/bin/test /usr/ucb/test; do
+gln -s foo "$scratchdir/testlink"
+for cmd in /usr/bin/gtest /usr/ucb/bin/test /usr/ucb/test; do
     for switch in -h -L; do
         if $cmd $switch "$scratchdir/testlink" 2>/dev/null; then
             # how nice
@@ -472,7 +472,7 @@
     done
 done
 # ok, now get rid of it
-rm "$scratchdir/testlink"
+grm "$scratchdir/testlink"
 
 
 if [ "x$TEST_SYMLINK_CMD" = 'x' ]; then
