3 # This program is distributable under the terms of the GNU GPL (see
6 # Test that rsync handles basic ACL preservation.
10 $RSYNC -VV |
grep '"ACLs": true' >/dev
/null || test_skipped
"Rsync is configured without ACL support"
12 makepath
"$fromdir/foo"
13 echo something
>"$fromdir/file1"
14 echo else >"$fromdir/file2"
16 files
='foo file1 file2'
18 case "$setfacl_nodef" in
20 if ! chmod --help 2>&1 |
grep -F +a
>/dev
/null
; then
21 test_skipped
"I don't know how to use setfacl or chmod for ACLs"
23 chmod +a
"root allow read,write,execute" "$fromdir/foo" || test_skipped
"Your filesystem has ACLs disabled"
24 chmod +a
"root allow read,execute" "$fromdir/file1"
25 chmod +a
"admin allow read" "$fromdir/file1"
26 chmod +a
"daemon allow read,write" "$fromdir/file1"
27 chmod +a
"root allow read,execute" "$fromdir/file2"
34 setfacl
-m u
:0:7 "$fromdir/foo" || test_skipped
"Your filesystem has ACLs disabled"
35 setfacl
-m g
:1:5 "$fromdir/foo"
36 setfacl
-m g
:2:1 "$fromdir/foo"
37 setfacl
-m g
:0:7 "$fromdir/foo"
38 setfacl
-m u
:2:1 "$fromdir/foo"
39 setfacl
-m u
:1:5 "$fromdir/foo"
41 setfacl
-m u
:0:5 "$fromdir/file1"
42 setfacl
-m g
:0:4 "$fromdir/file1"
43 setfacl
-m u
:1:6 "$fromdir/file1"
45 setfacl
-m u
:0:5 "$fromdir/file2"
54 $RSYNC -avvA $files "$todir/"
56 see_acls
$files >"$scratchdir/acls.txt"
59 see_acls
$files |
diff $diffopt "$scratchdir/acls.txt" -
61 # The script would have aborted on error, so getting here means we've won.