1 # Copyright (c) 2011 Edward Tomasz NapieraĆa <trasz@FreeBSD.org>
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
7 # 1. Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # 2. Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
13 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 # This is a tools-level test for acl_is_trivial_np(3). Run it as root on ZFS.
29 # Note that this does not work on UFS with NFSv4 ACLs enabled - UFS recognizes
30 # both kind of trivial ACLs and replaces it by the default one.
32 # WARNING: Creates files in unsafe way.
38 # Check whether ls(1) correctly recognizes PSARC/2010/029-style trivial ACLs.
41 $ ls -l xxx | cut -d' ' -f1
45 > owner@:rw-p--aARWcCos:------:allow
46 > group@:r-----a-R-c--s:------:allow
47 > everyone@:r-----a-R-c--s:------:allow
49 # Check whether ls(1) correctly recognizes draft-style trivial ACLs.
52 $ setfacl -a0 owner@:x:deny,owner@:rwpAWCo:allow,group@:wxp:deny,group@:r:allow,everyone@:wxpAWCo:deny,everyone@:raRcs:allow xxx
57 $ ls -l xxx | cut -d' ' -f1
61 > owner@:--x-----------:------:deny
62 > owner@:rw-p---A-W-Co-:------:allow
63 > group@:-wxp----------:------:deny
64 > group@:r-------------:------:allow
65 > everyone@:-wxp---A-W-Co-:------:deny
66 > everyone@:r-----a-R-c--s:------:allow
68 # Make sure ls(1) actually can recognize something as non-trivial.
71 $ ls -l xxx | cut -d' ' -f1
75 > owner@:rw-p---A-W-Co-:------:allow
76 > group@:-wxp----------:------:deny
77 > group@:r-------------:------:allow
78 > everyone@:-wxp---A-W-Co-:------:deny
79 > everyone@:r-----a-R-c--s:------:allow