chmod.test 979 B

12345678910111213141516171819202122232425262728293031
  1. #! /bin/sh
  2. # Copyright (C) 2004 by Wayne Davison <wayned@samba.org>
  3. # This program is distributable under the terms of the GNU GPL (see
  4. # COPYING).
  5. # Test that various read-only and set[ug]id permissions work properly,
  6. # even when using a --temp-dir option (which we try to point at a
  7. # different filesystem than the destination dir).
  8. . "$suitedir/rsync.fns"
  9. hands_setup
  10. chmod 440 "$fromdir/text"
  11. chmod 500 "$fromdir/dir/text"
  12. e="$fromdir/dir/subdir/foobar.baz"
  13. chmod 6450 "$e" || chmod 2450 "$e" || chmod 1450 "$e" || chmod 450 "$e"
  14. e="$fromdir/dir/subdir/subsubdir/etc-ltr-list"
  15. chmod 2670 "$e" || chmod 1670 "$e" || chmod 670 "$e"
  16. # First a normal copy.
  17. runtest "normal copy" 'checkit "$RSYNC -avv \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"'
  18. # Then we update all the files.
  19. runtest "update copy" 'checkit "$RSYNC -avvI --no-whole-file \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"'
  20. # The script would have aborted on error, so getting here means we've won.
  21. exit 0