1 # This is a tools-level test for POSIX.1e ACL functionality. Run it as root
2 # using ACL-enabled kernel:
4 # /usr/src/tools/regression/acltools/run /usr/src/tools/regression/acltools/tools-posix.test
6 # WARNING: Creates files in unsafe way.
14 # Smoke test for getfacl(1).
29 $ setfacl -m u:42:r,g:43:w xxx
41 # Check whether ls correctly marks files with "+".
42 $ ls -l xxx | cut -d' ' -f1
45 # Same as above, but for symlinks.
68 $ setfacl -hm u:44:x,g:45:w lll
80 # XXX: Why doesn't ls(1) print '+' for symbolic links with ACL set?
81 $ ls -l lll | cut -d' ' -f1
84 # Check whether the original file is left untouched.
85 $ ls -l xxx | cut -d' ' -f1
90 # Test removing entries.
91 $ setfacl -x user:42: xxx
102 $ setfacl -m g:43:r xxx
113 # Make sure cp without any flags does not copy the ACL.
115 $ ls -l yyy | cut -d' ' -f1
118 # Make sure it does with the "-p" flag.
133 # Test removing entries by... by example?
134 $ setfacl -m u:42:r,g:43:w xxx
135 $ setfacl -x u:42: xxx
157 $ ls -l xxx | cut -d' ' -f1
169 $ ls -l xxx | cut -d' ' -f1
172 # Check setfacl(1) and getfacl(1) with multiple files.
175 $ ls -l xxx yyy zzz | cut -d' ' -f1
180 $ setfacl -m u:42:x,g:43:w nnn xxx yyy zzz
181 > setfacl: stat() of nnn failed: No such file or directory
183 $ ls -l nnn xxx yyy zzz | cut -d' ' -f1
184 > ls: nnn: No such file or directory
189 $ getfacl -q nnn xxx yyy zzz
190 > getfacl: nnn: No such file or directory
212 $ setfacl -b nnn xxx yyy zzz
213 > setfacl: stat() of nnn failed: No such file or directory
215 $ ls -l nnn xxx yyy zzz | cut -d' ' -f1
216 > ls: nnn: No such file or directory
221 $ setfacl -bn nnn xxx yyy zzz
222 > setfacl: stat() of nnn failed: No such file or directory
224 $ ls -l nnn xxx yyy zzz | cut -d' ' -f1
225 > ls: nnn: No such file or directory
232 # Check whether chmod actually does what it should do.
234 $ setfacl -m u:42:rwx,g:43:rwx xxx
241 > user:42:rwx # effective: ---
242 > group::r-- # effective: ---
243 > group:43:rwx # effective: ---
253 > user:42:rwx # effective: rw-
255 > group:43:rwx # effective: rw-
267 $ ls -l | grep ddd | cut -d' ' -f1
271 $ setfacl -dm u::rwx,g::rx,o::rx,mask::rwx ddd
278 # No change - ls(1) output doesn't take into account default ACLs.
279 $ ls -l | grep ddd | cut -d' ' -f1
282 $ setfacl -dm g:42:rwx,u:42:r ddd
283 $ setfacl -dm g::w ddd
292 $ setfacl -dx group:42: ddd
300 $ ls -l | grep ddd | cut -d' ' -f1
324 $ setfacl -dm u::rwx,g::rx,o::rx,mask::rwx ddd
325 $ setfacl -dm g:42:rwx,u:43:r ddd
338 > group::r-x # effective: r--
339 > group:42:rwx # effective: r--
348 > group:42:rwx # effective: r-x
356 # Test if we deal properly with fifos.
358 $ ls -l fff | cut -d' ' -f1
361 $ setfacl -m u:42:r,g:43:w fff
373 $ ls -l fff | cut -d' ' -f1
385 $ ls -l fff | cut -d' ' -f1