xfstests: kill useless test owner fields
[xfstests-dev.git] / 237
1 #! /bin/bash
2 # FS QA Test No. 237
3 #
4 # Check user B can setfacl a file which belongs to user A
5 # See also http://marc.info/?l=linux-btrfs&m=127434445620298&w=2
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2010 FUJITSU LIMITED. All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25
26 seq=`basename $0`
27 echo "QA output created by $seq"
28
29 here=`pwd`
30 tmp=/tmp/$$
31 runas=$here/src/runas
32 status=1        # FAILure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
34
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
38 . ./common.attr
39
40 _cleanup()
41 {
42         cd /
43         rm -f $tmp.*
44         [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
45         _cleanup_testdir
46 }
47
48 # real QA test starts here
49 _supported_fs generic
50 # only Linux supports fallocate
51 _supported_os Linux
52
53 [ -x $runas ] || _notrun "$runas executable not found"
54
55 rm -f $seq.full
56
57 _setup_testdir
58
59 _need_to_be_root
60 _acl_setup_ids
61 _require_acls
62
63 # get dir
64 cd $testdir
65 rm -rf $seq.dir1
66 mkdir $seq.dir1
67 cd $seq.dir1
68
69 touch file1
70 chown $acl1.$acl1 file1
71
72 echo "Expect to FAIL"
73 $runas -u $acl2 -g $acl2 -- `which setfacl` -m u::rwx file1 2>&1 | sed 's/^setfacl: \/.*file1: Operation not permitted$/setfacl: file1: Operation not permitted/'
74
75 echo "Test over."
76 # success, all done
77 status=0
78 exit