3 # Copyright (C) 2002 by Martin Pool <mbp@samba.org>
5 # This program is distributable under the terms of the GNU GPL (see
8 # Test that when rsync is running as root and has -a it correctly sets
9 # the ownership of the destination.
11 # We don't know what users will be present on this system, so we just
12 # use random numeric uids and gids.
14 . "$suitedir/rsync.fns"
17 '') ;; # If "id" failed, try to continue...
19 *) if [ -f /usr/bin/fakeroot ]; then
20 echo "Let's try re-running the script under fakeroot..."
21 exec /usr/bin/fakeroot /bin/sh "$0"
26 # Build some hardlinks
29 name1="$fromdir/name1"
30 name2="$fromdir/name2"
31 echo "This is the file" > "$name1"
32 echo "This is the other file" > "$name2"
34 chown 5000 "$name1" || test_skipped "Can't chown (probably need root)"
35 chown 5001 "$name2" || test_skipped "Can't chown (probably need root)"
36 chgrp 5002 "$name1" || test_skipped "Can't chgrp (probably need root)"
37 chgrp 5003 "$name2" || test_skipped "Can't chgrp (probably need root)"
39 checkit "$RSYNC -aHvv \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
41 # The script would have aborted on error, so getting here means we've won.