Whamcloud - gitweb
b=3031
[fs/lustre-release.git] / lustre / tests / setfacl.test
1 !
2 ! setfacl tests.
3 !
4 ! Run these tests on a filesystem with ACL support.
5 !
6 $ umask 027
7 $ touch g
8 $ acl_mode g
9 -rw-r-----
10 $ setfacl -m m:- g
11 $ acl_mode g
12 -rw-------+
13 $ getfacl g
14 # file: g
15 # owner: @OWNER@
16 # group: @GROUP@
17 user::rw-
18 group::r--      #effective:---
19 mask::---
20 other::---
21
22 $ setfacl -x m g
23 $ getfacl g
24 # file: g
25 # owner: @OWNER@
26 # group: @GROUP@
27 user::rw-
28 group::r--
29 other::---
30
31 $ setfacl -m u:joe:rw g
32 $ getfacl g
33 # file: g
34 # owner: @OWNER@
35 # group: @GROUP@
36 user::rw-
37 user:joe:rw-
38 group::r--
39 mask::rw-
40 other::---
41
42 $ setfacl -m u::rwx,g::r-x,o:- g
43 $ getfacl g
44 # file: g
45 # owner: @OWNER@
46 # group: @GROUP@
47 user::rwx
48 user:joe:rw-
49 group::r-x
50 mask::rwx
51 other::---
52
53 $ setfacl -m u::rwx,g::r-x,o:-,m:- g
54 $ getfacl g
55 # file: g
56 # owner: @OWNER@
57 # group: @GROUP@
58 user::rwx
59 user:joe:rw-    #effective:---
60 group::r-x      #effective:---
61 mask::---
62 other::---
63
64 $ setfacl -m u::rwx,g::r-x,o:-,u:root:-,m:- g
65 $ getfacl g
66 # file: g
67 # owner: @OWNER@
68 # group: @GROUP@
69 user::rwx
70 user:root:---
71 user:joe:rw-    #effective:---
72 group::r-x      #effective:---
73 mask::---
74 other::---
75
76 $ setfacl -m u::rwx,g::r-x,o:-,u:root:-,m:- g
77 $ getfacl g
78 # file: g
79 # owner: @OWNER@
80 # group: @GROUP@
81 user::rwx
82 user:root:---
83 user:joe:rw-    #effective:---
84 group::r-x      #effective:---
85 mask::---
86 other::---
87
88 $ setfacl -m u::rwx,g::r-x,o:-,u:root:- g
89 $ getfacl g
90 # file: g
91 # owner: @OWNER@
92 # group: @GROUP@
93 user::rwx
94 user:root:---
95 user:joe:rw-
96 group::r-x
97 mask::rwx
98 other::---
99
100 $ setfacl --test -x u: g
101 setfacl: g: Malformed access ACL `user:root:---,user:joe:rw-,group::r-x,mask::rwx,other::---': Missing or wrong entry at entry 1
102 $ setfacl --test -x u:x
103 setfacl: Option -x: Invalid argument near character 3
104 $ setfacl -m d:u:root:rwx g
105 setfacl: g: Only directories can have default ACLs
106 $ setfacl -x m g
107 setfacl: g: Malformed access ACL `user::rwx,user:root:---,user:joe:rw-,group::r-x,other::---': Missing or wrong entry at entry 5
108 !setfacl --test -m d:u:joe:rwx setfacl
109 !setfacl --test -n -m d:u:joe:rwx setfacl
110 $ rm g
111 !
112 ! Check if the mask is properly recalculated
113 !
114 $ mkdir d
115 $ setfacl --test -m u::rwx,u:@OWNER@:rwx,g::r-x,o::--- d
116 d: u::rwx,u:@OWNER@:rwx,g::r-x,m::rwx,o::---,*
117 $ setfacl --test -m u::rwx,u:@OWNER@:rwx,g::r-x,m::---,o::--- d
118 d: u::rwx,u:@OWNER@:rwx,g::r-x,m::---,o::---,*
119 $ setfacl --test -d -m u::rwx,u:@OWNER@:rwx,g::r-x,o::--- d
120 d: *,d:u::rwx,d:u:@OWNER@:rwx,d:g::r-x,d:m::rwx,d:o::---
121 $ setfacl --test -d -m u::rwx,u:@OWNER@:rwx,g::r-x,m::---,o::--- d
122 d: *,d:u::rwx,d:u:@OWNER@:rwx,d:g::r-x,d:m::---,d:o::---
123 $ rmdir d