5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
29 # Copyright (c) 2013 by Delphix. All rights reserved.
32 .
$STF_SUITE/tests
/functional
/delegate
/delegate_common.kshlib
36 # Scan the following permissions one by one to verify privileged user
37 # has correct permission delegation in datasets.
40 # 1. Delegate all the permission one by one to user on dataset.
41 # 2. Verify privileged user has correct permission without any other
42 # permissions allowed.
45 verify_runnable
"both"
47 log_assert
"Verify privileged user has correct permissions once which was "\
48 "delegated to him in datasets"
49 log_onexit restore_root_datasets
52 # Results in Results in
53 # Permission Filesystem Volume
55 set -A perms create true false \
61 reservation true true \
62 recordsize true false \
63 mountpoint true false \
65 compression true true \
76 aclinherit true false \
85 if is_global_zone
; then
86 typeset
-i n
=${#perms[@]}
87 perms
[((n
))]="sharenfs"; perms
[((n
+1))]="true"; perms
[((n
+2))]="false"
88 perms
[((n
+3))]="share"; perms
[((n
+4))]="true"; perms
[((n
+5))]="false"
91 for dtst
in $DATASETS; do
93 typeset
type=$
(get_prop
type $dtst)
94 [[ $type == "volume" ]] && k
=2
97 while (( i
< ${#perms[@]} )); do
98 log_must
$ZFS allow
$STAFF1 ${perms[$i]} $dtst
100 if [[ ${perms[((i+k))]} == "true" ]]; then
101 log_must verify_perm
$dtst ${perms[$i]} $STAFF1
103 log_must verify_noperm
$dtst ${perms[$i]} $STAFF1
106 log_must restore_root_datasets
112 log_pass
"Verify privileged user has correct permissions " \
113 "in datasets passed."