Fix compile w/o openssl; disable sha256 & sha512 for --checksum.
[rsync.git] / testsuite / chmod-temp-dir.test
blob362d9d993525d929debbb68a18f82c7c84788eaf
1 #!/bin/sh
3 # Copyright (C) 2004-2022 Wayne Davison
5 # This program is distributable under the terms of the GNU GPL (see
6 # COPYING).
8 # Test that various read-only and set[ug]id permissions work properly,
9 # even when using a --temp-dir option (which we try to point at a
10 # different filesystem than the destination dir).
12 . "$suitedir/rsync.fns"
14 hands_setup
16 sdev=`$TOOLDIR/getfsdev $scratchdir`
17 tdev=$sdev
19 for tmpdir2 in "${RSYNC_TEST_TMP:-/override-tmp-not-specified}" /run/shm /var/tmp /tmp; do
20 [ -d "$tmpdir2" ] && [ -w "$tmpdir2" ] || continue
21 tdev=`$TOOLDIR/getfsdev "$tmpdir2"`
22 [ x$sdev != x$tdev ] && break
23 done
25 [ x$sdev = x$tdev ] && test_skipped "Can't find a tmp dir on a different file system"
27 chmod 440 "$fromdir/text"
28 chmod 500 "$fromdir/dir/text"
29 e="$fromdir/dir/subdir/foobar.baz"
30 chmod 6450 "$e" || chmod 2450 "$e" || chmod 1450 "$e" || chmod 450 "$e"
31 e="$fromdir/dir/subdir/subsubdir/etc-ltr-list"
32 chmod 2670 "$e" || chmod 1670 "$e" || chmod 670 "$e"
34 # First a normal copy.
35 runtest "normal copy" 'checkit "$RSYNC -avv --temp-dir=\"$tmpdir2\" \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"'
37 # Then we update all the files.
38 runtest "update copy" 'checkit "$RSYNC -avvI --no-whole-file --temp-dir=\"$tmpdir2\" \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"'
40 # The script would have aborted on error, so getting here means we've won.
41 exit 0