From 2d5707c7479eacb3b1ad98e01b53f56a88f8fb78 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 18:14:31 +0200 Subject: Adding upstream version 3.2.7. Signed-off-by: Daniel Baumann --- testsuite/chmod-temp-dir.test | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 testsuite/chmod-temp-dir.test (limited to 'testsuite/chmod-temp-dir.test') diff --git a/testsuite/chmod-temp-dir.test b/testsuite/chmod-temp-dir.test new file mode 100644 index 0000000..362d9d9 --- /dev/null +++ b/testsuite/chmod-temp-dir.test @@ -0,0 +1,41 @@ +#!/bin/sh + +# Copyright (C) 2004-2022 Wayne Davison + +# This program is distributable under the terms of the GNU GPL (see +# COPYING). + +# Test that various read-only and set[ug]id permissions work properly, +# even when using a --temp-dir option (which we try to point at a +# different filesystem than the destination dir). + +. "$suitedir/rsync.fns" + +hands_setup + +sdev=`$TOOLDIR/getfsdev $scratchdir` +tdev=$sdev + +for tmpdir2 in "${RSYNC_TEST_TMP:-/override-tmp-not-specified}" /run/shm /var/tmp /tmp; do + [ -d "$tmpdir2" ] && [ -w "$tmpdir2" ] || continue + tdev=`$TOOLDIR/getfsdev "$tmpdir2"` + [ x$sdev != x$tdev ] && break +done + +[ x$sdev = x$tdev ] && test_skipped "Can't find a tmp dir on a different file system" + +chmod 440 "$fromdir/text" +chmod 500 "$fromdir/dir/text" +e="$fromdir/dir/subdir/foobar.baz" +chmod 6450 "$e" || chmod 2450 "$e" || chmod 1450 "$e" || chmod 450 "$e" +e="$fromdir/dir/subdir/subsubdir/etc-ltr-list" +chmod 2670 "$e" || chmod 1670 "$e" || chmod 670 "$e" + +# First a normal copy. +runtest "normal copy" 'checkit "$RSYNC -avv --temp-dir=\"$tmpdir2\" \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"' + +# Then we update all the files. +runtest "update copy" 'checkit "$RSYNC -avvI --no-whole-file --temp-dir=\"$tmpdir2\" \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"' + +# The script would have aborted on error, so getting here means we've won. +exit 0 -- cgit v1.2.3