zfs_acl_chmod_xattr_002_pos.ksh revision 1d32ba663e202c24a5a1f2e5aef83fffb447cb7f
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2016 by Delphix. All rights reserved.
#
#
# DESCRIPTION:
# Verify that the write_xattr for remove the extended attributes of
#
# STRATEGY:
# 1. Create file and directory in zfs filesystem
# 2. Set special write_xattr ACE to the file and directory
# 3. Try to remove the extended attributes of the file and directory
# 4. Verify above operation is successful.
#
verify_runnable "both"
function cleanup
{
cd $cwd
if [[ -e $TESTDIR/$ARCHIVEFILE ]]; then
fi
return 0
}
# owner@ group group_users other_users
set -A users \
"root" "root" "$ZFS_ACL_ADMIN" "$ZFS_ACL_OTHER1" \
set -A a_access \
"write_xattr:allow" \
"write_xattr:deny"
set -A a_flag "owner@" "group@" "everyone@"
log_assert "Verify that the permission of write_xattr for " \
function operate_node #user node acl
{
typeset user=$1
typeset node=$2
typeset acl_t=$3
typeset ret
log_fail "user, node are not defined."
fi
fi
return $ret
}
function logname #acl_target owner user
{
typeset acl_target=$1
typeset owner=$2
typeset user=$3
typeset ret="log_mustnot"
# To super user, read and write deny permission was override.
ret="log_must"
fi
print $ret
}
function check_chmod_results #node flag acl_target owner g_usr o_usr
{
typeset node=$1
typeset flag=$2
typeset acl_target=$2:$3
typeset owner=$4
typeset g_usr=$5
typeset o_usr=$6
typeset log
fi
fi
fi
}
function test_chmod_basic_access #node owner g_usr o_usr
{
typeset node=${1%/}
typeset owner=$2
typeset g_usr=$3
typeset o_usr=$4
done
done
}
function setup_test_files #base_node user group
{
typeset base_node=$1
typeset user=$2
typeset group=$3
return 0
}
function cleanup_test_files #base_node
{
typeset base_node=$1
if [[ -d $base_node ]]; then
elif [[ -e $base_node ]]; then
log_must rm -f $base_node
fi
return 0
}
typeset ARCHIVEFILE=archive.tar
typeset -i i=0
typeset -i j=0
typeset target
while (( i < ${#users[@]} )); do
cd $TESTDIR
j=0
while (( j < 1 )); do
test_chmod_basic_access $target ${users[i]} \
"${users[((i+2))]}" "${users[((i+3))]}"
test_chmod_basic_access $target ${users[i]} \
"${users[((i+2))]}" "${users[((i+3))]}"
(( j = j + 1 ))
done
(( i += 4 ))
done