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