2 # copy files/directories across file system boundaries
3 # and make sure acls are preserved appropriately
5 # Copyright (C) 2005, 2006 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 # Make sure we get English translations.
24 . $srcdir/../lang-default
26 if test "$VERBOSE" = yes; then
34 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
35 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
36 trap '(exit $?); exit $?' 1 2 13 15
39 mkdir -p $tmp || framework_failure=1
40 cd $tmp || framework_failure=1
42 mkdir -p a b || framework_failure=1
43 touch a/file || framework_failure=1
45 if test $framework_failure = 1; then
46 echo 'failure in testing framework'
51 # Ensure that setfacl and getfacl work on this file system.
52 setfacl -m user:bin:rw a/file 2> /dev/null || skip=yes
53 acl1=`cd a && getfacl file | grep -v ':bin:' | grep -v 'mask::'` \
58 echo "$0: '.' is not on a suitable file system for this test" 1>&2
59 echo "$0: skipping this test" 1>&2
63 # copy a file without preserving permissions
64 cp a/file b/ || fail=1
66 acl2=`cd b && getfacl file` || framework_failure=1
67 test "$acl1" = "$acl2" || fail=1
68 rm a/file || framework_failure=1
70 # copy a file, preserving permissions
71 touch a/file || framework_failure=1
72 setfacl -m user:bin:rw a/file || framework_failure=1
73 acl1=`cd a && getfacl file` || framework_failure=1
74 cp -p a/file b/ || fail=1
75 acl2=`cd b && getfacl file` || framework_failure=1
76 test "$acl1" = "$acl2" || fail=1
78 if test $framework_failure = 1; then
79 echo 'failure in testing framework'